Ask Your Question
7

complex exponential/trigonometric

asked 2010-09-25 21:36:07 +0100

yaman gravatar image

updated 2024-07-09 08:27:47 +0100

FrédéricC gravatar image

Is there any command equivalent to the Mathematica's "TrigToExp" and "ExpToTrig"? Where should I look for general support on complex exponential/trigonometric functions?

edit retag flag offensive close merge delete

4 Answers

Sort by » oldest newest most voted
5

answered 2010-09-29 07:12:31 +0100

Mitesh Patel gravatar image

updated 2010-09-29 07:14:30 +0100

This works for me in Sage 4.5.3:

sage: x = var('x')
sage: t1 = cos(x)
sage: t2 = e^(I * x) / 2 / I - e^(-I * x) / 2 / I
sage: sageobj(t1._maxima_().exponentialize())
1/2*e^(-I*x) + 1/2*e^(I*x)
sage: sageobj(t2._maxima_().demoivre())
sin(x)

Perhaps there's a simpler way? I don't think we've wrapped Maxima's demoivre and exponentialize in Sage. They're documented here.

edit flag offensive delete link more

Comments

Oh, that's great. Can you file a ticket to do so - perhaps with Mma-like notation, if it ends up being appropriate?

kcrisman gravatar imagekcrisman ( 2010-09-29 23:41:45 +0100 )edit
Mitesh Patel gravatar imageMitesh Patel ( 2010-09-30 00:10:18 +0100 )edit

The correct link is https://trac.sagemath.org/ticket/10038 Unfortunately, the ticket seems stalled at the moment.

eric_g gravatar imageeric_g ( 2016-12-21 15:53:16 +0100 )edit
2

answered 2021-08-12 15:44:45 +0100

Emmanuel Charpentier gravatar image

updated 2021-10-13 10:55:41 +0100

A proposal to Trac#10038 (relevant ticket) needs review...

Possible interim workarounds :

sage: var("a, b")
(a, b)
sage: sin(x).maxima_methods().exponentialize()
-1/2*I*e^(I*x) + 1/2*I*e^(-I*x)
sage: tan(x)._sympy_().rewrite("exp")._sage_()
-I*(e^(I*x) - e^(-I*x))/(e^(I*x) + e^(-I*x))
sage: exp(a + I*b).maxima_methods().demoivre()
(cos(b) + I*sin(b))*e^a
sage: exp(I*x)._sympy_().rewrite("sin")._sage_()
cos(x) + I*sin(x)
sage: exp(x)._sympy_().rewrite("sin")._sage_()
cosh(x) + sinh(x)

EDIT : This proposal has been integrated in 9.5.beta0 ; the SymbolicRing class has now demoivre and exponentialize methods (implemented in sage, not directly in ginac/pynac, which is way above my pay grade...).

HTH,

edit flag offensive delete link more
1

answered 2012-03-25 12:56:48 +0100

daniel kho gravatar image

Hi, just wondering if any work has been done on this yet? It's been a while, so I thought there may be some updates. Anyway, I'm a total exponentiation geek (or call me anti-trigonometric freak if you like), so a simple TrigToExp function in Sage would be nice.

edit flag offensive delete link more
1

answered 2021-08-05 21:23:52 +0100

litvath gravatar image

Are there any updates on that?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

5 followers

Stats

Asked: 2010-09-25 21:36:07 +0100

Seen: 3,450 times

Last updated: Oct 13 '21