2.4.38 Problem 35

Maple
Mathematica
Sympy

Internal problem ID [8926]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 35
Date solved : Friday, April 25, 2025 at 05:24:47 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

Solve

xy+(1+x)y+2y=0

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.

xy+(1+x)y+2y=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)=1+xxq(x)=2x
Table 2.90: Table p(x),q(x) singularites.
p(x)=1+xx
singularity type
x=0 “regular”
q(x)=2x
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

xy+(1+x)y+2y=0

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)x(n=0(n+r)(n+r1)anxn+r2)+(1+x)(n=0(n+r)anxn+r1)+2(n=0anxn+r)=0

Which simplifies to

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

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

n=0xn+ran(n+r)=n=1an1(n+r1)xn+r1n=02anxn+r=n=12an1xn+r1

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

(2B)(n=0xn+r1an(n+r)(n+r1))+(n=1an1(n+r1)xn+r1)+(n=0(n+r)anxn+r1)+(n=12an1xn+r1)=0

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

xn+r1an(n+r)(n+r1)+(n+r)anxn+r1=0

When n=0 the above becomes

x1+ra0r(1+r)+ra0x1+r=0

Or

(x1+rr(1+r)+rx1+r)a0=0

Since a00 then the above simplifies to

x1+rr2=0

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

r2=0

Solving for r gives the roots of the indicial equation as

r1=0r2=0

Since a00 then the indicial equation becomes

x1+rr2=0

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

Since the root of the indicial equation is repeated, then we can construct two linearly independent solutions. The first solution has the form

(1A)y1(x)=n=0anxn+r

Now the second solution y2 is found using

(1B)y2(x)=y1(x)ln(x)+(n=1bnxn+r)

Then the general solution will be

y=c1y1(x)+c2y2(x)

In Eq (1B) the sum starts from 1 and not zero. In Eq (1A), a0 is never zero, and is arbitrary and is typically taken as a0=1, and {c1,c2} are two arbitray constants of integration which can be found from initial conditions. We start by finding the first solution 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. For 1n the recursive equation is

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

Solving for an from recursive equation (4) gives

(4)an=an1(n+r+1)n2+2nr+r2

Which for the root r=0 becomes

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

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

n an,r an
a0 1 1

For n=1, using the above recursive equation gives

a1=2r(r+1)2

Which for the root r=0 becomes

a1=2

And the table now becomes

n an,r an
a0 1 1
a1 2r(r+1)2 2

For n=2, using the above recursive equation gives

a2=3+r(2+r)(r+1)2

Which for the root r=0 becomes

a2=32

And the table now becomes

n an,r an
a0 1 1
a1 2r(r+1)2 2
a2 3+r(2+r)(r+1)2 32

For n=3, using the above recursive equation gives

a3=4r(2+r)(3+r)(r+1)2

Which for the root r=0 becomes

a3=23

And the table now becomes

n an,r an
a0 1 1
a1 2r(r+1)2 2
a2 3+r(2+r)(r+1)2 32
a3 4r(2+r)(3+r)(r+1)2 23

For n=4, using the above recursive equation gives

a4=5+r(4+r)(2+r)(3+r)(r+1)2

Which for the root r=0 becomes

a4=524

And the table now becomes

n an,r an
a0 1 1
a1 2r(r+1)2 2
a2 3+r(2+r)(r+1)2 32
a3 4r(2+r)(3+r)(r+1)2 23
a4 5+r(4+r)(2+r)(3+r)(r+1)2 524

For n=5, using the above recursive equation gives

a5=6r(5+r)(4+r)(2+r)(3+r)(r+1)2

Which for the root r=0 becomes

a5=120

And the table now becomes

n an,r an
a0 1 1
a1 2r(r+1)2 2
a2 3+r(2+r)(r+1)2 32
a3 4r(2+r)(3+r)(r+1)2 23
a4 5+r(4+r)(2+r)(3+r)(r+1)2 524
a5 6r(5+r)(4+r)(2+r)(3+r)(r+1)2 120

Using the above table, then the first solution y1(x) becomes

y1(x)=a0+a1x+a2x2+a3x3+a4x4+a5x5+a6x6=12x+3x222x33+5x424x520+O(x6)

Now the second solution is found. The second solution is given by

y2(x)=y1(x)ln(x)+(n=1bnxn+r)

Where bn is found using

bn=ddran,r

And the above is then evaluated at r=0. The above table for an,r is used for this purpose. Computing the derivatives gives the following table

n bn,r an bn,r=ddran,r bn(r=0)
b0 1 1 N/A since bn starts from 1 N/A
b1 2r(r+1)2 2 3+r(r+1)3 3
b2 3+r(2+r)(r+1)2 32 2r211r13(2+r)2(r+1)3 134
b3 4r(2+r)(3+r)(r+1)2 23 3r3+27r2+74r+62(2+r)2(3+r)2(r+1)3 3118
b4 5+r(4+r)(2+r)(3+r)(r+1)2 524 4r454r3256r2504r346(4+r)2(2+r)2(3+r)2(r+1)3 173288
b5 6r(5+r)(4+r)(2+r)(3+r)(r+1)2 120 5r5+95r4+685r3+2335r2+3744r+2244(5+r)2(4+r)2(2+r)2(3+r)2(r+1)3 1871200

The above table gives all values of bn needed. Hence the second solution is

y2(x)=y1(x)ln(x)+b0+b1x+b2x2+b3x3+b4x4+b5x5+b6x6=(12x+3x222x33+5x424x520+O(x6))ln(x)+3x13x24+31x318173x4288+187x51200+O(x6)

Therefore the homogeneous solution is

yh(x)=c1y1(x)+c2y2(x)=c1(12x+3x222x33+5x424x520+O(x6))+c2((12x+3x222x33+5x424x520+O(x6))ln(x)+3x13x24+31x318173x4288+187x51200+O(x6))

Hence the final solution is

y=yh=c1(12x+3x222x33+5x424x520+O(x6))+c2((12x+3x222x33+5x424x520+O(x6))ln(x)+3x13x24+31x318173x4288+187x51200+O(x6))
Maple. Time used: 0.029 (sec). Leaf size: 44
Order:=6; 
ode:=x*diff(diff(y(x),x),x)+(1+x)*diff(y(x),x)+2*y(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
y=(c2ln(x)+c1)(12x+32x223x3+524x4120x5+O(x6))+(3x134x2+3118x3173288x4+1871200x5+O(x6))c2

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 
   A Liouvillian solution exists 
   Reducible group (found an exponential solution) 
   Group is reducible, not completely reducible 
<- Kovacics algorithm successful
 

Maple step by step

Let’s solvex(ddxddxy(x))+(1+x)(ddxy(x))+2y(x)=0Highest derivative means the order of the ODE is2ddxddxy(x)Isolate 2nd derivativeddxddxy(x)=2y(x)x(1+x)(ddxy(x))xGroup terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearddxddxy(x)+(1+x)(ddxy(x))x+2y(x)x=0Check to see ifx0=0is a regular singular pointDefine functions[P2(x)=1+xx,P3(x)=2x]xP2(x)is analytic atx=0(xP2(x))|x=0=1x2P3(x)is analytic atx=0(x2P3(x))|x=0=0x=0is a regular singular pointCheck to see ifx0=0is a regular singular pointx0=0Multiply by denominatorsx(ddxddxy(x))+(1+x)(ddxy(x))+2y(x)=0Assume series solution fory(x)y(x)=k=0akxk+rRewrite ODE with series expansionsConvertxm(ddxy(x))to series expansion form=0..1xm(ddxy(x))=k=0ak(k+r)xk+r1+mShift index usingk>k+1mxm(ddxy(x))=k=1+mak+1m(k+1m+r)xk+rConvertx(ddxddxy(x))to series expansionx(ddxddxy(x))=k=0ak(k+r)(k+r1)xk+r1Shift index usingk>k+1x(ddxddxy(x))=k=1ak+1(k+1+r)(k+r)xk+rRewrite ODE with series expansionsa0r2x1+r+(k=0(ak+1(k+1+r)2+ak(k+r+2))xk+r)=0a0cannot be 0 by assumption, giving the indicial equationr2=0Values of r that satisfy the indicial equationr=0Each term in the series must be 0, giving the recursion relationak+1(k+1)2+ak(k+2)=0Recursion relation that defines series solution to ODEak+1=ak(k+2)(k+1)2Recursion relation forr=0ak+1=ak(k+2)(k+1)2Solution forr=0[y(x)=k=0akxk,ak+1=ak(k+2)(k+1)2]
Mathematica. Time used: 0.007 (sec). Leaf size: 111
ode=x*D[y[x],{x,2}] +(1+x)*D[y[x],x]+2*y[x] == 0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)c1(x520+5x4242x33+3x222x+1)+c2(187x51200173x4288+31x31813x24+(x520+5x4242x33+3x222x+1)log(x)+3x)
Sympy. Time used: 0.823 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), (x, 2)) + (x + 1)*Derivative(y(x), x) + 2*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
y(x)=C1(x520+5x4242x33+3x222x+1)+O(x6)