# [Maxima] technical question on Maxima

Stavros Macrakis macrakis at alum.mit.edu
Fri Jun 29 08:04:10 CDT 2012

```Here's an approach that often works for expressing exponentials as
hyperbolic functions:

(%i1) ex: %e^(a*x) + %e^(x-b)\$

(%i3) subst(%e^(qq*%i*x),%e,ex);
(%o3) %e^(%i*a*qq*x^2)+%e^(%i*qq*x*(x-b))

(%i4) rectform(%);
(%o4) %i*(sin(a*qq*x^2)+sin(qq*x*(x-b)))+cos(a*qq*x^2)+cos(qq*x*(x-b))
(%i5) subst(-%i,qq,%);
(%o5) %i*(-%i*sinh(a*x^2)-%i*sinh(x*(x-b)))+cosh(a*x^2)+cosh(x*(x-b))
(%i6) ratsimp(%);
(%o6) sinh(x^2-b*x)+cosh(x^2-b*x)+sinh(a*x^2)+cosh(a*x^2)

or...:

(%i8) demoivre(%o3);
(%o8) %i*sin(a*qq*x^2)+cos(a*qq*x^2)+%i*sin(qq*x*(x-b))+cos(qq*x*(x-b))
(%i9) subst(-%i,qq,%);
(%o9) sinh(a*x^2)+cosh(a*x^2)+sinh(x*(x-b))+cosh(x*(x-b))

Does this help in your case?

-s

On Thu, Jun 28, 2012 at 3:15 PM, Jerome Huck <jeromehuck at orange.fr> wrote:

> From Jerome Huck
>
> Good morning.
> I do not know if you are the right people but I have a technical
> question/idea relative to Maxima.
> Can you forward my mail to them ?
>
>
> Best regards.
>
> Good morning.
> I was trying to solve some complicated 3D flow with approximations using
> Maxima.
> I need to solve a 2nd order diff equation, the one on attached hardcopy
> HC. Instead of having having exp in the output, I would like to have
> hyperbolic sinh/cosh functions. I did the same problem with changing the
> plus into a minus for the zero order term and the solution is clean with
> Maxima, even with the boundary conditions, see HC1.
>
> I downloaded the source code of Maxima to try to find an explanation. I
> have a good knowledge of SCHEME language which is a derivative of  LISP.
> I found the ODE2/MAC and ODE2.USG and try to understand them.
>
> In Maxima, in CC2, in this ODE2 source code you have the EXPONENTIALIZE
> to control the kind of output, a sin/cos solution or classical exp
> function. (as the control flag in MAXIMA)
>
>  if exponentialize = false then
>     return(y = %e^(-%f%*x/2) * (%k1*sin(alpha) + %k2*cos(alpha))),
>   return(y = %e^(-%f%*x/2) * (%k1*exp(%i*alpha) + %k2*exp(-%i*alpha))))
>
>
> Why  do we not have an HYPERBOLIZE to control the output of CC2,
> SINH/COSH or exp, a few lignes above in CC2?
> It could be a good idea to improve the solution. With my problem, when I
> put my boundary conditions, I ended with a very complicated
> expression...and I further need this solution to improve this output for
> my complex 3D flow.
>
> What do you think, a good idea for a further release of MAXIMA?
>
> Best regards.
>
> Jerome Huck.
>
>
>
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120629/36591edb/attachment.html>
```