| 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.
| 2 | No.2 Revision |
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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.