# Math Help - Taylor Series solution

1. ## 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

2. 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

$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 $a_0=2,\ a_1=1.$

Then:

$
(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 $x^3$ (that will give you all the coefficients you will need to solve for the coefficients up to and including $a_5$) and equate coefficients of like powers of x on both sides.

RonL

3. Thanks for the reply but you've lost me already. how does that solve the ODE?

4. 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:

$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:

$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 $a$'s (that is $a_0=y(0)$, and $a_1=y'(0)$ ).

RonL

5. Yeah i've been looking at this with some friends and we're gonna need it explained like we're 2 yr olds as we can't get our heads around it at all.

6. 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 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?

7. 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

8. Originally Posted by CaptainBlack
Put

$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 $a_0=2,\ a_1=1.$

Then:

$
(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 $x^3$ (that will give you all the coefficients you will need to solve for the coefficients up to and including $a_5$) and equate coefficients of like powers of x on both sides.

RonL
$
(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:

$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:

$4a_2=0$

$12a_3+2a_2=1$

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

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

which you solve for the $a$'s

RonL

(Check the algebra!)

9. So i've equated the co-efficients, are these the values for y"', y"" & y""'?

10. Originally Posted by CaptainBlack
$
(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:

$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:

$4a_2=0$

$12a_3+2a_2=1$

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

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

which you solve for the $a$'s

RonL

(Check the algebra!)
So we have $a_2=0,\ a_3=1/12,\ a_4=-1/48,\ a_5=1/160$, so we have:

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

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

RonL

(again check the algebra)

11. 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