Taylor Series solution

• Sep 15th 2008, 10:02 PM
Watto81
Taylor Series solution
Hi all,

I have to solve y" = x/y where y'(0)=1 & y(0)=2 By Taylor series method to get the value of y at x=0.1 and x=0.5. Use terms through x^5 but am having trouble enough solving the ODE to begin with.

Any ideas would be most appreciated!!

Cheers
• Sep 15th 2008, 11:06 PM
CaptainBlack
Quote:

Originally Posted by Watto81
Hi all,

I have to solve y" = x/y where y'(0)=1 & y(0)=2 By Taylor series method to get the value of y at x=0.1 and x=0.5. Use terms through x^5 but am having trouble enough solving the ODE to begin with.

Any ideas would be most appreciated!!

Cheers

Put

$\displaystyle y(x)=a_0+a_1x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..$

and from the initial conditions you know that $\displaystyle a_0=2,\ a_1=1.$

Then:

$\displaystyle (a_0+a_1x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..)(2a_2+6a_3x+12a_4x^2+20a_5x^3+..)=x$

Expand the left hand side as far as the term in $\displaystyle x^3$ (that will give you all the coefficients you will need to solve for the coefficients up to and including $\displaystyle a_5$) and equate coefficients of like powers of x on both sides.

RonL
• Sep 16th 2008, 01:50 AM
Watto81
Thanks for the reply but you've lost me already. how does that solve the ODE?
• Sep 16th 2008, 02:02 AM
CaptainBlack
Quote:

Originally Posted by Watto81
Thanks for the reply but you've lost me already. how does that solve the ODE?

You do not solve the ODE as such, you are working with a series solution which we suppose to be:

$\displaystyle y(x)=\sum_{j=0}^{\infty}a_jx^j$

Then we explore the consequences of our supposition that this satisfies the ODE, in this case we have:

$\displaystyle y(x)y''(x)=x$

We expand the product on the left using the assumed series, and then equate coefficients of like powers on both sides of this equation to solve for as many coefficients as we need.

The initial conditions for the ODE provide us with starting values for the $\displaystyle a$'s (that is $\displaystyle a_0=y(0)$, and $\displaystyle a_1=y'(0)$ ).

RonL
• Sep 16th 2008, 03:33 AM
Watto81
Yeah i've been looking at this with some friends and we're gonna need it explained like we're 2 yr olds (Headbang) as we can't get our heads around it at all.
• Sep 16th 2008, 03:46 AM
Jameson
Quote:

Originally Posted by Watto81
Yeah i've been looking at this with some friends and we're gonna need it explained like we're 2 yr olds (Headbang) as we can't get our heads around it at all.

I don't follow this completely, but the general idea is straightforward enough I think.

Do you see that CaptainBlack just wrote a general Taylor expansion for y(x)? Then he took the second derivative for a few terms. You're D.E. says that yy''=x, so he multiplied these two series expansions. They are infinite expansions but you only need x^5 as your highest term, and when you multiply the LHS of course the powers will add so you really do not need that many terms.

Does that part make sense? Writing y and y'' in terms of a general Taylor expansion.

The only part I'm not seeing is when CB says after expanding the product on the LHS equating powers to get coefficients. Equating the product with what? Just x?
• Sep 16th 2008, 06:33 AM
CaptainBlack
Quote:

Originally Posted by Jameson
I don't follow this completely, but the general idea is straightforward enough I think.

Do you see that CaptainBlack just wrote a general Taylor expansion for y(x)? Then he took the second derivative for a few terms. You're D.E. says that yy''=x, so he multiplied these two series expansions. They are infinite expansions but you only need x^5 as your highest term, and when you multiply the LHS of course the powers will add so you really do not need that many terms.

Does that part make sense? Writing y and y'' in terms of a general Taylor expansion.

The only part I'm not seeing is when CB says after expanding the product on the LHS equating powers to get coefficients. Equating the product with what? Just x?

The right hand side is also a power series which just happens to have only one non zero coefficient, so we are just equating coefficients of power series (in fact polynomials by that point).

To be honest if I do much more of this problem I will have solved it for you, and that is not my intention.

RonL
• Sep 16th 2008, 06:45 AM
CaptainBlack
Quote:

Originally Posted by CaptainBlack
Put

$\displaystyle y(x)=a_0+a_1x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..$

and from the initial conditions you know that $\displaystyle a_0=2,\ a_1=1.$

Then:

$\displaystyle (a_0+a_1x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..)(2a_2+6a_3x+12a_4x^2+20a_5x^3+..)=x$

Expand the left hand side as far as the term in $\displaystyle x^3$ (that will give you all the coefficients you will need to solve for the coefficients up to and including $\displaystyle a_5$) and equate coefficients of like powers of x on both sides.

RonL

$\displaystyle (2+x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..)(2a_2+6a_3x+12a_4x^2+20a_5x^3+..)=x$

so:

$\displaystyle 4a_2+x(12a_3+2a_2)+x^2(24a_4+6a_3+2a_2^2)+x^3(40a_ 5+12a_4+8a_2a_3) + ..=x$

Hence equating the coefficients of corresponding powers of x on both sides of this; we have:

$\displaystyle 4a_2=0$

$\displaystyle 12a_3+2a_2=1$

$\displaystyle 24a_4+6a_3+2a_2^2=0$

$\displaystyle 40a_5+12a_4+8a_2a_3=0$

which you solve for the $\displaystyle a$'s

RonL

(Check the algebra!)
• Sep 17th 2008, 03:33 AM
Watto81
So i've equated the co-efficients, are these the values for y"', y"" & y""'?
• Sep 17th 2008, 03:45 AM
CaptainBlack
Quote:

Originally Posted by CaptainBlack
$\displaystyle (2+x+a_2x^2+a_3x^3+a_4x^4+a_5x^5 + ..)(2a_2+6a_3x+12a_4x^2+20a_5x^3+..)=x$

so:

$\displaystyle 4a_2+x(12a_3+2a_2)+x^2(24a_4+6a_3+2a_2^2)+x^3(40a_ 5+12a_4+8a_2a_3) + ..=x$

Hence equating the coefficients of corresponding powers of x on both sides of this; we have:

$\displaystyle 4a_2=0$

$\displaystyle 12a_3+2a_2=1$

$\displaystyle 24a_4+6a_3+2a_2^2=0$

$\displaystyle 40a_5+12a_4+8a_2a_3=0$

which you solve for the $\displaystyle a$'s

RonL

(Check the algebra!)

So we have $\displaystyle a_2=0,\ a_3=1/12,\ a_4=-1/48,\ a_5=1/160$, so we have:

$\displaystyle y(x)=2 + x + \frac{1}{12}x^3-\frac{1}{48}x^4+\frac{1}{160}x^5+..$

so $\displaystyle y(0.1)\approx 2.10008$ and $\displaystyle y(0.5) \approx 2.50931$

RonL

(again check the algebra)
• Sep 17th 2008, 03:47 AM
CaptainBlack
Quote:

Originally Posted by Watto81
So i've equated the co-efficients, are these the values for y"', y"" & y""'?

No they are the coefficients of the corresponding powers of x in the power series expansion of y(x)

RonL