Today I was calculating some stuff with the help of SAGE, and realize that the expressions got a lot (really, a lot) simpler if they where written in terms of hyperbolic functions instead of exponentials.

So I enter the **sage-devel** channel of IRC (freenode), but there was a lazy day around… Sunday. Therefore I decided to write to the **sage-dev** group on Google groups.

Francois Maltey answer my question on how to do the transformation… He has written a package that does it!

Let follow his instructions…

look at the second line the “attachement” (in smaller characters)

and get the most recent file.

In Sage, type : load “/the/good/file/in/the/good/directory’

Then call the rewrite function.

Thank you Francois

#### Example

Suppose the path to the file is “/home/me/rewrite-xxx.sage”

`sage: load "/home/me/rewrite-xxx.sage"`

sage: A = exp(x) + exp(-x)

sage: rewrite(A, 'exp2sinhconh')

2*cosh(x)

If you go to http://wiki.sagemath.org/symbolics/rewrite, will find all possible commands which perform such transformations.

Enjoy!

Dox

on January 23, 2011 at 9:44 pm |SimonThat looks handy!

on February 24, 2011 at 11:22 pm |SAGE tip: Exponentiate a Matrix « Doxdrum's Blog[…] The only problem here is that, even when the relations are simple in this example, I’ve not found a `trivial’ way of simplifying the matrix elements of the exponentiation, not even with the procedure post in here. I didn’t try with the rewrite package […]