2.4.69 Problem 66

Maple
Mathematica
Sympy

Internal problem ID [8958]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 66
Date solved : Wednesday, March 05, 2025 at 07:09:40 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

Solve

y+(x1)y=0

Using series expansion around x=0

Solving ode using Taylor series method. This gives review on how the Taylor series method works for solving second order ode.

Let

y=f(x,y,y)

Assuming expansion is at x0=0 (we can always shift the actual expansion point to 0 by change of variables) and assuming f(x,y,y) is analytic at x0 which must be the case for an ordinary point. Let initial conditions be y(x0)=y0 and y(x0)=y0. Using Taylor series gives

y(x)=y(x0)+(xx0)y(x0)+(xx0)22y(x0)+(xx0)33!y(x0)+=y0+xy0+x22f|x0,y0,y0+x33!f|x0,y0,y0+=y0+xy0+n=0xn+2(n+2)!dnfdxn|x0,y0,y0

But

(1)dfdx=fxdxdx+fydydx+fydydx(1)=fx+fyy+fyy(2)=fx+fyy+fyfd2fdx2=ddx(dfdx)(2)=x(dfdx)+y(dfdx)y+y(dfdx)fd3fdx3=ddx(d2fdx2)(3)=x(d2fdx2)+(yd2fdx2)y+y(d2fdx2)f

And so on. Hence if we name F0=f(x,y,y) then the above can be written as

(4)F0=f(x,y,y)F1=dfdx=dF0dx=fx+fyy+fyy(5)=fx+fyy+fyf=F0x+F0yy+F0yF0F2=ddx(ddxf)=ddx(F1)=xF1+(F1y)y+(F1y)y=xF1+(F1y)y+(F1y)F0Fn=ddx(Fn1)=xFn1+(Fn1y)y+(Fn1y)y(6)=xFn1+(Fn1y)y+(Fn1y)F0

Therefore (6) can be used from now on along with

(7)y(x)=y0+xy0+n=0xn+2(n+2)!Fn|x0,y0,y0

To find y(x) series solution around x=0. Hence

F0=(x1)yF1=dF0dx=F0x+F0yy+F0yF0=y(x1)yF2=dF1dx=F1x+F1yy+F1yF1=2y+(x1)2yF3=dF2dx=F2x+F2yy+F2yF2=(x1)((x1)y+4y)F4=dF3dx=F3x+F3yy+F3yF3=(x1)3y+(6x6)y+4y

And so on. Evaluating all the above at initial conditions x=0 and y(0)=y(0) and y(0)=y(0) gives

F0=y(0)F1=y(0)+y(0)F2=2y(0)+y(0)F3=y(0)4y(0)F4=5y(0)6y(0)

Substituting all the above in (7) and simplifying gives the solution as

y=(1+12x216x3+124x4130x5)y(0)+(x+16x3112x4+1120x5)y(0)+O(x6)

Since the expansion point x=0 is an ordinary point, then this can also be solved using the standard power series method. Let the solution be represented as power series of the form

y=n=0anxn

Then

y=n=1nanxn1y=n=2n(n1)anxn2

Substituting the above back into the ode gives

(1)(n=2n(n1)anxn2)+(x1)(n=0anxn)=0

Which simplifies to

(2)(n=2n(n1)anxn2)+(n=0x1+nan)+n=0(anxn)=0

The next step is to make all powers of x be n in each summation term. Going over each summation term above with power of x in it which is not already xn and adjusting the power and the corresponding index gives

n=2n(n1)anxn2=n=0(n+2)an+2(1+n)xnn=0x1+nan=n=1an1xn

Substituting all the above in Eq (2) gives the following equation where now all powers of x are the same and equal to n.

(3)(n=0(n+2)an+2(1+n)xn)+(n=1an1xn)+n=0(anxn)=0

n=0 gives

2a2a0=0
a2=a02

For 1n, the recurrence equation is

(4)(n+2)an+2(1+n)+an1an=0

Solving for an+2, gives

(5)an+2=an1+an(n+2)(1+n)=an(n+2)(1+n)an1(n+2)(1+n)

For n=1 the recurrence equation gives

6a3+a0a1=0

Which after substituting the earlier terms found becomes

a3=a06+a16

For n=2 the recurrence equation gives

12a4+a1a2=0

Which after substituting the earlier terms found becomes

a4=a112+a024

For n=3 the recurrence equation gives

20a5+a2a3=0

Which after substituting the earlier terms found becomes

a5=a030+a1120

For n=4 the recurrence equation gives

30a6+a3a4=0

Which after substituting the earlier terms found becomes

a6=a0144a1120

For n=5 the recurrence equation gives

42a7+a4a5=0

Which after substituting the earlier terms found becomes

a7=11a15040a0560

And so on. Therefore the solution is

y=n=0anxn=a3x3+a2x2+a1x+a0+

Substituting the values for an found above, the solution becomes

y=a0+a1x+a0x22+(a06+a16)x3+(a112+a024)x4+(a030+a1120)x5+

Collecting terms, the solution becomes

(3)y=(1+12x216x3+124x4130x5)a0+(x+16x3112x4+1120x5)a1+O(x6)

At x=0 the solution above becomes

y=(1+12x216x3+124x4130x5)c1+(x+16x3112x4+1120x5)c2+O(x6)
Maple. Time used: 0.002 (sec). Leaf size: 54
Order:=6; 
ode:=diff(diff(y(x),x),x)+(-1+x)*y(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
y=(1+12x216x3+124x4130x5)y(0)+(x+16x3112x4+1120x5)y(0)+O(x6)

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
checking if the LODE is of Euler type 
trying a symmetry of the form [xi=0, eta=F(x)] 
checking if the LODE is missing y 
-> Trying a Liouvillian solution using Kovacics algorithm 
<- No Liouvillian solutions exists 
-> Trying a solution in terms of special functions: 
   -> Bessel 
   <- Bessel successful 
<- special function solution successful`
 

Maple step by step

Let’s solved2dx2y(x)+(x1)y(x)=0Highest derivative means the order of the ODE is2d2dx2y(x)Assume series solution fory(x)y(x)=k=0akxkRewrite ODE with series expansionsConvertxmy(x)to series expansion form=0..1xmy(x)=k=max(0,m)akxk+mShift index usingk>kmxmy(x)=k=max(0,m)+makmxkConvertd2dx2y(x)to series expansiond2dx2y(x)=k=2akk(k1)xk2Shift index usingk>k+2d2dx2y(x)=k=0ak+2(k+2)(k+1)xkRewrite ODE with series expansions2a2a0+(k=1(ak+2(k+2)(k+1)ak+ak1)xk)=0Each term must be 02a2a0=0Each term in the series must be 0, giving the recursion relation(k2+3k+2)ak+2+ak1ak=0Shift index usingk>k+1((k+1)2+3k+5)ak+3+akak+1=0Recursion relation that defines the series solution to the ODE[y(x)=k=0akxk,ak+3=akak+1k2+5k+6,2a2a0=0]
Mathematica. Time used: 0.001 (sec). Leaf size: 63
ode=D[y[x],{x,2}]+(x-1)*y[x]==0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)c2(x5120x412+x36+x)+c1(x530+x424x36+x22+1)
Sympy. Time used: 0.780 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 1)*y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_ordinary",x0=0,n=6)
 
y(x)=C2(x424x36+x22+1)+C1x(x312+x26+1)+O(x6)