First time here? Check out the FAQ!

Ask Your Question
1

Factoring expression involving exponentials

asked 9 years ago

mforets gravatar image

I've got a complicated expression, which looks like: e(4ik+3iω+ip)−e(4ik+2iω+2ip)−e(4ik+2iω)+e(4ik+iω+ip)+2e(2ik+4iω+ip)−e(2ik+3iω+2ip)−e(2ik+3iω) + ...

How would you do to factor the exponentials with the same power of k, i.e. e(4ik)(...) + e(2ik)(...) and so on?

Preview: (hide)

3 Answers

Sort by » oldest newest most voted
1

answered 9 years ago

mforets gravatar image

Using both ideas we can formulate a complete answer (assume that expr(k) is the expression in terms of phases in powers of k that we want to factor):

f1(k) = expr(-I*log(k)); f1
g1(k) = f1.canonicalize_radical(); g1
g1(k).coefficient(k,4)
Preview: (hide)
link
1

answered 9 years ago

updated 9 years ago

Maybe by a change of variables:

sage: var('k,w,p')

sage: expr(k,w,p)=exp(4ik+3iw+ip)-exp(4ik+2iw+2ip)-exp(4ik+2iw)+exp(4ik+iw+ip)+2exp(2ik+4iw+ip)-
exp(2
ik+3iw+2ip)-exp(2ik+3i*w)

sage: f(k,w,p)=expr(log(k),log(w),log(p))

sage: g(k,w,p)=f.canonicalize_radical()

sage: g(exp(k),exp(w),exp(p)).factor()

Preview: (hide)
link

Comments

This answer was useful, thanks. But at the end factor doesn't work as expected (it just leds to the original expression). We can use instead use the coefficient function to conclude.

mforets gravatar imagemforets ( 9 years ago )
1

answered 9 years ago

fidbc gravatar image

I would probably try using the factor method.

sage: var('x,y,z')
(x, y, z)
sage: expr=exp(4*x-2*y+4*z)+exp(4*x-3*y+5*z)
sage: expr.factor()
(e^y + e^z)*e^(4*x - 3*y + 4*z)

Perhaps the manual will contain useful info on that as well.

Preview: (hide)
link

Comments

Thanks, but you can see this doesn't do the job: the goal was to collect the terms in exp(4x), and so on (try adding for instance exp(2x-3y+5z) and factoring, it does something correct but is not what I need). I thought it'd be useful a previous step transforming the exp(2x) into z and exp(4x) into z^2, etc and then factoring, but I am not able to get the substitution done..

mforets gravatar imagemforets ( 9 years ago )

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 9 years ago

Seen: 751 times

Last updated: Oct 11 '15