Hello!
I am trying to replace hyperbolic trig with it's expanded form. As a concrete example I would like to replace
arcsinh(z) = ln( z + sqrt(z^2 + 1) )
Now I can do this if I knew that it was actually arcsinh(z) using subs, specifically using the command;
test = arcsinh(z)
test2 = test.subs_expr(arcsinh(z) == (log (z + sqrt((z^2 + 1))) )
The problem is that this seems to work only if it's an exact string match. Meaning if I tried;
test = arcsinh(1/3*x + 1/3)
test2 = test.subs_expr(arcsinh(z) == (log (z + sqrt((z^2 + 1))) )
I get
test2 = arcsinh(1/3*x + 1/3)
Is there a way to replace anything of the form
arcsinh(stuff) -> log (stuff + sqrt((stuff)^2 + 1))
Or does sage have this built in somewhere? I want to ideally make a sage function that I can pass a (randomly generated) mathematical expression to and have it expand the hyperbolic pieces for me. Thus I won't know the argument of the hyperbolic beforehand most of the time.
To give a concrete example, I would like to have something along the following:
a = random(1,1000)
b = random(1,1000)
f = a*arcsinh(b*x + a^2) - b
f2 = f.magicsimplifyfunction()
and get out
f2 = a*log (b*x + a^2 + sqrt((b*x + a^2)^2 + 1)) - b
Where the magicsimplifyfunction is the function that will work on any such f, not tailored to that specific f.
Thanks!