The SR.exponentialize
method implements :
sage: [u(x)==u(x)._sympy_().rewrite("exp")._sage_()
....: for u in (sin, cos, tan, csc, sec, cot, sinh, cosh, tanh, csch, sech, coth)]
[sin(x) == -1/2*I*e^(I*x) + 1/2*I*e^(-I*x),
cos(x) == 1/2*e^(I*x) + 1/2*e^(-I*x),
tan(x) == -I*(e^(I*x) - e^(-I*x))/(e^(I*x) + e^(-I*x)),
csc(x) == 2*I/(e^(I*x) - e^(-I*x)),
sec(x) == 2/(e^(I*x) + e^(-I*x)),
cot(x) == I*(e^(I*x) + e^(-I*x))/(e^(I*x) - e^(-I*x)),
sinh(x) == -1/2*e^(-x) + 1/2*e^x,
cosh(x) == 1/2*e^(-x) + 1/2*e^x,
tanh(x) == -(e^(-x) - e^x)/(e^(-x) + e^x),
csch(x) == -2/(e^(-x) - e^x),
sech(x) == 2/(e^(-x) + e^x),
coth(x) == -(e^(-x) + e^x)/(e^(-x) - e^x)]
However, we also have :
sage: [u(x)==u(x)._sympy_().rewrite("log")._sage_()
....: for u in (arcsin, arccos, arctan, arccsc, arcsec, arccot, arcsinh, arccosh, arctanh, arccsch, arcsech, arccoth)]
[arcsin(x) == -I*log(I*x + sqrt(-x^2 + 1)),
arccos(x) == 1/2*pi + I*log(I*x + sqrt(-x^2 + 1)),
arctan(x) == -1/2*I*log(I*x + 1) + 1/2*I*log(-I*x + 1),
arccsc(x) == -I*log(sqrt(-1/x^2 + 1) + I/x),
arcsec(x) == 1/2*pi + I*log(sqrt(-1/x^2 + 1) + I/x),
arccot(x) == -1/2*I*log(I/x + 1) + 1/2*I*log(-I/x + 1),
arcsinh(x) == log(x + sqrt(x^2 + 1)),
arccosh(x) == log(sqrt(x + 1)*sqrt(x - 1) + x),
arctanh(x) == 1/2*log(x + 1) - 1/2*log(-x + 1),
arccsch(x) == log(sqrt(1/x^2 + 1) + 1/x),
arcsech(x) == log(sqrt(1/x + 1)*sqrt(1/x - 1) + 1/x),
arccoth(x) == 1/2*log(1/x + 1) - 1/2*log(-1/x + 1)]
Hence two questions :
Is it worth implementing it (for the benefit of high-school/undergrads/engineering math) ?
Should it be implemented by SR.exponentialize
or by a distinct method ? (My preference is for the former, notwithstanding the apparent discrepancy in names…).
Your advice is welcome.
BTW, (too ?) simple check :
sage: all(map(lambda u,v:bool(u(v(x)._sympy_().rewrite("log")._sage_()).exponentialize().simplify_full()==x),
....: (sin, cos, tan, csc, sec, cot, sinh, cosh, tanh, csch, sech, coth),
....: (arcsin, arccos, arctan, arccsc, arcsec, arccot, arcsinh, arccosh, arctanh, arccsch, arcsech, arccoth)))
True
Never mind : I went ahead and created Trac#34108, which needs_review
(hint, hint….).
HTH,