Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: Series Expansions in Mathematica
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Alexei Boulbitch

Posts: 483
Registered: 2/28/08
Re: Series Expansions in Mathematica
Posted: Feb 20, 2013 10:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,
I am attempting to expand an equation, and then solve the 1st, 2nd, 3rd, 4th and 5th order expressions one at a time.

The equation is:

Exp[4 x] - c Exp[3 y] Exp[4 x] + c - 1 = 0

With, x and y small variables to be expanded and c a constant. Once this is expanded, the variables x and y are in turn replaced with expansions written as:

x = x[1] + x[2]/2 + x[3]/6 + x[4]/24 + x[5]/120 (to 5th order)

By the time I have completed these expansions, I have a somewhat long expression. Does Mathematica have an intelligent way of deciding which terms would be 1st/2nd/etc order? For example, x[1] y[2] and x[1]^2 y[1] would both be third order.

Many thanks,
Sam Young


Hi, Sam,

Yes, you may go for troubles of solving this using series. Though you did not write what are you looking for as the function of what, I assume that you are looking for x=x(y), or reversed: y=y(x).

To explicitly answer your question:

a) This is the expansion:

expr2 = Series[
Exp[4 x] - c* Exp[3 y] Exp[4 x] + c - 1, {x, 0, 5}, {y, 0, 5}] //
Normal // Simplify

1/600 (-45 c y (40 + 60 y + 60 y^2 + 45 y^3 + 27 y^4) -
60 x (-40 +
c (40 + 120 y + 180 y^2 + 180 y^3 + 135 y^4 + 81 y^5)) -
120 x^2 (-40 +
c (40 + 120 y + 180 y^2 + 180 y^3 + 135 y^4 + 81 y^5)) -
160 x^3 (-40 +
c (40 + 120 y + 180 y^2 + 180 y^3 + 135 y^4 + 81 y^5)) -
160 x^4 (-40 +
c (40 + 120 y + 180 y^2 + 180 y^3 + 135 y^4 + 81 y^5)) -
128 x^5 (-40 +
c (40 + 120 y + 180 y^2 + 180 y^3 + 135 y^4 + 81 y^5)))

b) Now, like this you get coefficients:

Coefficient[expr2, #] & /@ {x, x^2, x^3, x^4, x^5} /. y -> 0

{1/10 (40 - 40 c),
1/5 (40 - 40 c), -(4/15) (-40 + 40 c), -(4/15) (-40 + 40 c), -(16/
75) (-40 + 40 c)}

Coefficient[expr2, #] & /@ {xy, x^2 y^2, x^3 y^3, x^4 y^4,
y^5 x^5} /. {y -> 0, x -> 0}

{0, -36 c, -48 c, -36 c, -((432 c)/25)}

I did not extract them all. It is your job to accurately do this. I only show the way.

However, your equation Mathematica can solve almost as it is, let alone that each of us is able to solve without can solve explicitly without any computer.

This slightly transforms your expression:


expr = Exp[4 x] - c* Exp[3 y] Exp[4 x] + c - 1 /. c -> Exp[b]

-1 + E^b + E^(4 x) - E^(b + 4 x + 3 y)

And this gives a solution.

Solve[expr == 0, x]

Solve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>

{{x -> Log[-((-1 + E^b)^(1/4)/(-1 + E^(b + 3 y))^(1/4))]}, {x ->
Log[-((I (-1 + E^b)^(1/4))/(-1 + E^(b + 3 y))^(1/4))]}, {x ->
Log[(I (-1 + E^b)^(1/4))/(-1 + E^(b + 3 y))^(1/4)]}, {x ->
Log[(-1 + E^b)^(1/4)/(-1 + E^(b + 3 y))^(1/4)]}}


Or another way around:

Solve[expr == 0, y]

{{y -> ConditionalExpression[
1/3 (-b - 4 x + 2 I \[Pi] C[1] + Log[-1 + E^b + E^(4 x)]),
C[1] \[Element] Integers]}}


Have fun, Alexei


Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG

Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44

e-mail: alexei.boulbitch@iee.lu







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.