Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,

As far as I know, there is no simple way to verify such identities with Sage yet. A related issue is that Sage is currently unable to simplify cosh(x) - (exp(x)+exp(-x))/2 to 0:

sage: (cosh(x) - (exp(x)+exp(-x))/2).simplify_full()
1/2*(2*cosh(x)*e^x - e^(2*x) - 1)*e^(-x)

But there is a workaround: the rewrite extension written by Fran├žois Maltey. To use it, download the file rewrite-20110123.sage from this page; then in a Sage session, you may ask to rewrite the hyperbolic functions in terms of exp, so that the outcome of the check is now True:

sage: %runfile rewrite-20110123.sage
sage: bool( rewrite(cosh(x), 'sinhcosh2exp') == (exp(x)+exp(-x))/2 )
True

See here for the documentation of rewrite. Hopefully, it shall be included in main Sage some day.

Hi,

As far as I know, there is no simple way to verify such identities with Sage yet. A related issue is that Sage is currently unable to simplify cosh(x) - (exp(x)+exp(-x))/2 to 0:

sage: (cosh(x) - (exp(x)+exp(-x))/2).simplify_full()
1/2*(2*cosh(x)*e^x - e^(2*x) - 1)*e^(-x)

But there is a workaround: the rewrite extension written by Fran├žois Maltey. To use it, download the file rewrite-20110123.sage from this page; then in a Sage session, you may ask to rewrite the hyperbolic functions in terms of exp, so that the outcome of the check is now True:

sage: %runfile rewrite-20110123.sage
sage: bool( rewrite(cosh(x), 'sinhcosh2exp') == (exp(x)+exp(-x))/2 )
True

Equivalently, you may also ask to rewrite the whole identity:

sage: bool( rewrite(cosh(x) == (exp(x)+exp(-x))/2, 'sinhcosh2exp') )
True

See here for the documentation of rewrite. Hopefully, it shall be included in main Sage some day.