2.4.5 Problem 5

Maple
Mathematica
Sympy

Internal problem ID [8894]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 5
Date solved : Wednesday, March 05, 2025 at 07:07:40 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Solve

2x2yxy+(x2+1)y=x2+x+1

Using series expansion around x=0

The type of the expansion point is first determined. This is done on the homogeneous part of the ODE.

2x2yxy+(x2+1)y=0

The following is summary of singularities for the above ode. Writing the ode as

y+p(x)y+q(x)y=0

Where

p(x)=12xq(x)=x212x2
Table 2.57: Table p(x),q(x) singularites.
p(x)=12x
singularity type
x=0 “regular”
q(x)=x212x2
singularity type
x=0 “regular”

Combining everything together gives the following summary of singularities for the ode as

Regular singular points : [0]

Irregular singular points : []

Since x=0 is regular singular point, then Frobenius power series is used. The ode is normalized to be

2x2yxy+(x2+1)y=x2+x+1

Since this is an inhomogeneous, then let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ode 2x2yxy+(x2+1)y=0, and yp is a particular solution to the inhomogeneous ode.which is found using the balance equation generated from indicial equation

First, we solve for yh Let the solution be represented as Frobenius power series of the form

y=n=0anxn+r

Then

y=n=0(n+r)anxn+r1y=n=0(n+r)(n+r1)anxn+r2

Substituting the above back into the ode gives

(1)2x2(n=0(n+r)(n+r1)anxn+r2)x(n=0(n+r)anxn+r1)+(x2+1)(n=0anxn+r)=0

Which simplifies to

(2A)(n=02xn+ran(n+r)(n+r1))+n=0(xn+ran(n+r))+n=0(xn+r+2an)+(n=0anxn+r)=0

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

n=0(xn+r+2an)=n=2(an2xn+r)

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

(2B)(n=02xn+ran(n+r)(n+r1))+n=0(xn+ran(n+r))+n=2(an2xn+r)+(n=0anxn+r)=0

The indicial equation is obtained from n=0. From Eq (2B) this gives

2xn+ran(n+r)(n+r1)xn+ran(n+r)+anxn+r=0

When n=0 the above becomes

2xra0r(1+r)xra0r+a0xr=0

Or

(2xrr(1+r)xrr+xr)a0=0

Since a00 then the above simplifies to

(2r23r+1)xr=0

Since the above is true for all x then the indicial equation becomes

2r23r+1=0

Solving for r gives the roots of the indicial equation as

r1=1r2=12

The corresponding balance equation is found by replacing r by m and a by c to avoid confusing terms between particular solution and the homogeneous solution. Hence the balance equation is

(2xmm(1+m)xmm+xm)c0=x2+x+1

This equation will used later to find the particular solution.

Since a00 then the indicial equation becomes

(2r23r+1)xr=0

Solving for r gives the roots of the indicial equation as [1,12].

Since r1r2=12 is not an integer, then we can construct two linearly independent solutions

y1(x)=xr1(n=0anxn)y2(x)=xr2(n=0bnxn)

Or

y1(x)=n=0anxn+1y2(x)=n=0bnxn+12

We start by finding y1(x). Eq (2B) derived above is now used to find all an coefficients. The case n=0 is skipped since it was used to find the roots of the indicial equation. a0 is arbitrary and taken as a0=1. Substituting n=1 in Eq. (2B) gives

a1=0

For 2n the recursive equation is

(3)2an(n+r)(n+r1)an(n+r)an2+an=0

Solving for an from recursive equation (4) gives

(4)an=an22n2+4nr+2r23n3r+1

Which for the root r=1 becomes

(5)an=an22n2+n

At this point, it is a good idea to keep track of an in a table both before substituting r=1 and after as more terms are found using the above recursive equation.

n an,r an
a0 1 1
a1 0 0

For n=2, using the above recursive equation gives

a2=12r2+5r+3

Which for the root r=1 becomes

a2=110

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 12r2+5r+3 110

For n=3, using the above recursive equation gives

a3=0

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 12r2+5r+3 110
a3 0 0

For n=4, using the above recursive equation gives

a4=14r4+36r3+113r2+144r+63

Which for the root r=1 becomes

a4=1360

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 12r2+5r+3 110
a3 0 0
a4 14r4+36r3+113r2+144r+63 1360

For n=5, using the above recursive equation gives

a5=0

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 12r2+5r+3 110
a3 0 0
a4 14r4+36r3+113r2+144r+63 1360
a5 0 0

Using the above table, then the solution y1(x) is

y1(x)=x(a0+a1x+a2x2+a3x3+a4x4+a5x5+a6x6)=x(1+x210+x4360+O(x6))

Now the second solution y2(x) is found. Eq (2B) derived above is now used to find all bn coefficients. The case n=0 is skipped since it was used to find the roots of the indicial equation. b0 is arbitrary and taken as b0=1. Substituting n=1 in Eq. (2B) gives

b1=0

For 2n the recursive equation is

(3)2bn(n+r)(n+r1)bn(n+r)bn2+bn=0

Solving for bn from recursive equation (4) gives

(4)bn=bn22n2+4nr+2r23n3r+1

Which for the root r=12 becomes

(5)bn=bn2n(2n1)

At this point, it is a good idea to keep track of bn in a table both before substituting r=12 and after as more terms are found using the above recursive equation.

n bn,r bn
b0 1 1
b1 0 0

For n=2, using the above recursive equation gives

b2=12r2+5r+3

Which for the root r=12 becomes

b2=16

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 12r2+5r+3 16

For n=3, using the above recursive equation gives

b3=0

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 12r2+5r+3 16
b3 0 0

For n=4, using the above recursive equation gives

b4=14r4+36r3+113r2+144r+63

Which for the root r=12 becomes

b4=1168

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 12r2+5r+3 16
b3 0 0
b4 14r4+36r3+113r2+144r+63 1168

For n=5, using the above recursive equation gives

b5=0

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 12r2+5r+3 16
b3 0 0
b4 14r4+36r3+113r2+144r+63 1168
b5 0 0

Using the above table, then the solution y2(x) is

y2(x)=x(b0+b1x+b2x2+b3x3+b4x4+b5x5+b6x6)=x(1+x26+x4168+O(x6))

Therefore the homogeneous solution is

yh(x)=c1y1(x)+c2y2(x)=c1x(1+x210+x4360+O(x6))+c2x(1+x26+x4168+O(x6))

The particular solution is found by solving for c,m the balance equation

(2xmm(1+m)xmm+xm)c0=F

Where F(x) is the RHS of the ode. If F(x) has more than one term, then this is done for each term one at a time and then all the particular solutions are added. The function F(x) will be converted to series if needed. in order to solve for cn,m for each term, the same recursive relation used to find yh(x) is used to find cn,m which is used to find the particular solution n=0cnxn+m by replacing an by cn and r by m.

The following are the values of an found in terms of the indicial root r.

a1=0
a2=a02r2+5r+3
a3=0
a4=a0(2r2+5r+3)(2r2+13r+21)
a5=0

Since the F=x2+x+1 has more than one term then we find a particular solution for each term and add the result to find the particular solution to the ode.

Now we determine the particular solution yp associated with F=x2 by solving the balance equation

(2xmm(1+m)xmm+xm)c0=x2

For c0 and x. This results in

c0=13m=2

The particular solution is therefore

yp=n=0cnxn+m=n=0cnxn+2

Where in the above c0=13.

The remaining cn values are found using the same recurrence relation given in the earlier table which was used to find the homogeneous solution but using c0 in place of a0 and using m=2 in place of the root of the indicial equation used to find the homogeneous solution. By letting a0=c0 or a0=13 and r=m or r=2. The following table gives the resulting cn values. These values will be used to find the particular solution. Values of cn found not defined when doing the substitution will be discarded and not used

c0=13
c1=0
c2=163
c3=0
c4=13465
c5=0

The particular solution is now found using

yp=xmn=0cnxn=x2n=0cnxn

Using the values found above for cn into the above sum gives

yp=x2(13+163x2+13465x4)=13x2+163x4+13465x6

Unable to solve the balance equation (2xmm(1+m)xmm+xm)c0 for c0 and x. No particular solution exists.

Failed to convert RHS x2+x+1 to series in order to find particular solution. Unable to solve. Terminating Unable to find the particular solution or no solution exists.

Maple
Order:=6; 
ode:=2*x^2*diff(diff(y(x),x),x)-x*diff(y(x),x)+(-x^2+1)*y(x) = x^2+x+1; 
dsolve(ode,y(x),type='series',x=0);
 
No solution found

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
-> Try solving first the homogeneous part of the ODE 
   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 
<- solving first the homogeneous part of the ODE successful`
 

Mathematica. Time used: 0.046 (sec). Leaf size: 224
ode=2*x^2*D[y[x],{x,2}] - x*D[y[x],x] + (1-x^2 )*y[x] ==1+x+x^2; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)c1x(x611088+x4168+x26+1)+c2x(x628080+x4360+x210+1)+x(79x11/2154440x9/2162037x7/21260x5/22511x3/2152x+2x)(x611088+x4168+x26+1)+x(x628080+x4360+x210+1)(x666528+67x555440+x4672+29x3504+x212+7x61x+log(x))
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x**2*Derivative(y(x), (x, 2)) - x**2 - x*Derivative(y(x), x) - x + (1 - x**2)*y(x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
ValueError : ODE 2*x**2*Derivative(y(x), (x, 2)) - x**2 - x*Derivative(y(x), x) - x + (1 - x**2)*y(x) - 1 does not match hint 2nd_power_series_regular