hyperbolic functions



Another possibility:

 (%i45) exp_to_tanh(e) := subst("^" = lambda([a,x], if a = '%e then (1 + tanh(x/2))/(1 - tanh(x/2)) else a^x),e)$

 (%i47) ratsimp(exp_to_tanh( y = (%e^(2*x)+1)/(%e^(2*x)-1)+%c));
 (%o47) y=(%c*tanh(x)+1)/tanh(x)

 (%i50) exp_to_tanh( y = x^2/9 + exp(x^2));
 (%o50) y=(tanh(x^2/2)+1)/(1-tanh(x^2/2))+x^2/9

Of course, it would be much better do the exp --> tanh substitution only when the result is something that 
is more appealing (aka simplified). 

--Barton

-----maxima-bounces at math.utexas.edu wrote: -----


>I?haven't?found?an?*automated*?way?of?reexpressing?this?with?tanh.
>However,?but?substituting?atanh(tanh(x))?for?x?(but?temporarily?blocking
>the?simplification),?you?can?derive?the?result:
>
>(%i56)?f:??y?=?(%e^(2*x)+1)/(%e^(2*x)-1)+%c$
>(%i57)?subst(atanh(box(tanh(x))),x,f);
>(%o57)?y?=
>(%e^(2*atanh(box(tanh(x))))+1)/(%e^(2*atanh(box(tanh(x))))-1)+%c
>
>(%i58)?expand(rembox(ratsimp(logarc(%))));
>(%o58)?y?=?1/tanh(x)+%c
>
>On?Sun,?Jan?9,?2011?at?06:08,?nijso?beishuizen
><nijso at numerically-related.com>?wrote:
>
>f:??y?=?(%e^(2*x)+1)/(%e^(2*x)-1)+%c;