2.4.39 Problem 36

Maple
Mathematica
Sympy

Internal problem ID [8928]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 36
Date solved : Sunday, March 30, 2025 at 01:55:33 PM
CAS classification : [[_2nd_order, _exact, _linear, _homogeneous]]

Solve

x(x1)y+3xy+y=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.

(x2x)y+3xy+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)=3x1q(x)=1x(x1)
Table 2.92: Table p(x),q(x) singularites.
p(x)=3x1
singularity type
x=1 “regular”
q(x)=1x(x1)
singularity type
x=0 “regular”
x=1 “regular”

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

Regular singular points : [1,0,]

Irregular singular points : []

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

x(x1)y+3xy+y=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(x1)(n=0(n+r)(n+r1)anxn+r2)+3x(n=0(n+r)anxn+r1)+(n=0anxn+r)=0

Which simplifies to

(2A)(n=0xn+ran(n+r)(n+r1))+n=0(xn+r1an(n+r)(n+r1))+(n=03xn+ran(n+r))+(n=0anxn+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+r1)=n=1an1(n+r1)(n+r2)xn+r1n=03xn+ran(n+r)=n=13an1(n+r1)xn+r1n=0anxn+r=n=1an1xn+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=1an1(n+r1)(n+r2)xn+r1)+n=0(xn+r1an(n+r)(n+r1))+(n=13an1(n+r1)xn+r1)+(n=1an1xn+r1)=0

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

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

When n=0 the above becomes

x1+ra0r(1+r)=0

Or

x1+ra0r(1+r)=0

Since a00 then the above simplifies to

x1+rr(1+r)=0

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

r(1+r)=0

Solving for r gives the roots of the indicial equation as

r1=1r2=0

Since a00 then the indicial equation becomes

x1+rr(1+r)=0

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

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

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

Or

y1(x)=x(n=0anxn)y2(x)=Cy1(x)ln(x)+(n=0bnxn)

Or

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

Where C above can be zero. We start by finding y1. 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)an1(n+r1)(n+r2)an(n+r)(n+r1)+3an1(n+r1)+an1=0

Solving for an from recursive equation (4) gives

(4)an=(n+r)an1n+r1

Which for the root r=1 becomes

(5)an=(n+1)an1n

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

For n=1, using the above recursive equation gives

a1=1+rr

Which for the root r=1 becomes

a1=2

And the table now becomes

n an,r an
a0 1 1
a1 1+rr 2

For n=2, using the above recursive equation gives

a2=2+rr

Which for the root r=1 becomes

a2=3

And the table now becomes

n an,r an
a0 1 1
a1 1+rr 2
a2 2+rr 3

For n=3, using the above recursive equation gives

a3=3+rr

Which for the root r=1 becomes

a3=4

And the table now becomes

n an,r an
a0 1 1
a1 1+rr 2
a2 2+rr 3
a3 3+rr 4

For n=4, using the above recursive equation gives

a4=4+rr

Which for the root r=1 becomes

a4=5

And the table now becomes

n an,r an
a0 1 1
a1 1+rr 2
a2 2+rr 3
a3 3+rr 4
a4 4+rr 5

For n=5, using the above recursive equation gives

a5=5+rr

Which for the root r=1 becomes

a5=6

And the table now becomes

n an,r an
a0 1 1
a1 1+rr 2
a2 2+rr 3
a3 3+rr 4
a4 4+rr 5
a5 5+rr 6

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

y1(x)=x(a0+a1x+a2x2+a3x3+a4x4+a5x5+a6x6)=x(1+2x+3x2+4x3+5x4+6x5+O(x6))

Now the second solution y2(x) is found. Let

r1r2=N

Where N is positive integer which is the difference between the two roots. r1 is taken as the larger root. Hence for this problem we have N=1. Now we need to determine if C is zero or not. This is done by finding limrr2a1(r). If this limit exists, then C=0, else we need to keep the log term and C0. The above table shows that

aN=a1=1+rr

Therefore

limrr21+rr=limr01+rr=undefined

Since the limit does not exist then the log term is needed. Therefore the second solution has the form

y2(x)=Cy1(x)ln(x)+(n=0bnxn+r2)

Therefore

ddxy2(x)=Cy1(x)ln(x)+Cy1(x)x+(n=0bnxn+r2(n+r2)x)=Cy1(x)ln(x)+Cy1(x)x+(n=0x1+n+r2bn(n+r2))d2dx2y2(x)=Cy1(x)ln(x)+2Cy1(x)xCy1(x)x2+n=0(bnxn+r2(n+r2)2x2bnxn+r2(n+r2)x2)=Cy1(x)ln(x)+2Cy1(x)xCy1(x)x2+(n=0x2+n+r2bn(n+r2)(1+n+r2))

Substituting these back into the given ode x(x1)y+3xy+y=0 gives

x(x1)(Cy1(x)ln(x)+2Cy1(x)xCy1(x)x2+n=0(bnxn+r2(n+r2)2x2bnxn+r2(n+r2)x2))+3x(Cy1(x)ln(x)+Cy1(x)x+(n=0bnxn+r2(n+r2)x))+Cy1(x)ln(x)+(n=0bnxn+r2)=0

Which can be written as

(7)((x(x1)y1(x)+3y1(x)x+y1(x))ln(x)+x(x1)(2y1(x)xy1(x)x2)+3y1(x))C+x(x1)(n=0(bnxn+r2(n+r2)2x2bnxn+r2(n+r2)x2))+3x(n=0bnxn+r2(n+r2)x)+(n=0bnxn+r2)=0

But since y1(x) is a solution to the ode, then

x(x1)y1(x)+3y1(x)x+y1(x)=0

Eq (7) simplifes to

(8)(x(x1)(2y1(x)xy1(x)x2)+3y1(x))C+x(x1)(n=0(bnxn+r2(n+r2)2x2bnxn+r2(n+r2)x2))+3x(n=0bnxn+r2(n+r2)x)+(n=0bnxn+r2)=0

Substituting y1=n=0anxn+r1 into the above gives

(9)(2x(x1)(n=0x1+n+r1an(n+r1))+(2x+1)(n=0anxn+r1))Cx+x2(x1)(n=0x2+n+r2bn(n+r2)(1+n+r2))+3x2(n=0x1+n+r2bn(n+r2))+(n=0bnxn+r2)xx=0

Since r1=1 and r2=0 then the above becomes

(10)(2x(x1)(n=0xnan(n+1))+(2x+1)(n=0anxn+1))Cx+x2(x1)(n=0x2+nbnn(n1))+3x2(n=0xn1bnn)+(n=0bnxn)xx=0

Which simplifies to

(2A)(n=02Cxn+1an(n+1))+n=0(2xnan(n+1)C)+(n=02Cxn+1an)+(n=0anxnC)+(n=0xnbnn(n1))+n=0(nxn1bn(n1))+(n=03xnbnn)+(n=0bnxn)=0

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

n=02Cxn+1an(n+1)=n=22Ca2+n(n1)xn1n=0(2xnan(n+1)C)=n=1(2Can1nxn1)n=02Cxn+1an=n=22Ca2+nxn1n=0anxnC=n=1Can1xn1n=0xnbnn(n1)=n=1(n1)bn1(2+n)xn1n=03xnbnn=n=13(n1)bn1xn1n=0bnxn=n=1bn1xn1

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

(2B)(n=22Ca2+n(n1)xn1)+n=1(2Can1nxn1)+(n=22Ca2+nxn1)+(n=1Can1xn1)+(n=1(n1)bn1(2+n)xn1)+n=0(nxn1bn(n1))+(n=13(n1)bn1xn1)+(n=1bn1xn1)=0

For n=0 in Eq. (2B), we choose arbitray value for b0 as b0=1. For n=N, where N=1 which is the difference between the two roots, we are free to choose b1=0. Hence for n=1, Eq (2B) gives

C+1=0

Which is solved for C. Solving for C gives

C=1

For n=2, Eq (2B) gives

(4a03a1)C+4b12b2=0

Which when replacing the above values found already for bn and the values found earlier for an and for C, gives

22b2=0

Solving the above for b2 gives

b2=1

For n=3, Eq (2B) gives

(6a15a2)C+9b26b3=0

Which when replacing the above values found already for bn and the values found earlier for an and for C, gives

126b3=0

Solving the above for b3 gives

b3=2

For n=4, Eq (2B) gives

(8a27a3)C+16b312b4=0

Which when replacing the above values found already for bn and the values found earlier for an and for C, gives

3612b4=0

Solving the above for b4 gives

b4=3

For n=5, Eq (2B) gives

(10a39a4)C+25b420b5=0

Which when replacing the above values found already for bn and the values found earlier for an and for C, gives

8020b5=0

Solving the above for b5 gives

b5=4

Now that we found all bn and C, we can calculate the second solution from

y2(x)=Cy1(x)ln(x)+(n=0bnxn+r2)

Using the above value found for C=1 and all bn, then the second solution becomes

y2(x)=1(x(1+2x+3x2+4x3+5x4+6x5+O(x6)))ln(x)+1x22x33x44x5+O(x6)

Therefore the homogeneous solution is

yh(x)=c1y1(x)+c2y2(x)=c1x(1+2x+3x2+4x3+5x4+6x5+O(x6))+c2(1(x(1+2x+3x2+4x3+5x4+6x5+O(x6)))ln(x)+1x22x33x44x5+O(x6))

Hence the final solution is

y=yh=c1x(1+2x+3x2+4x3+5x4+6x5+O(x6))+c2(x(1+2x+3x2+4x3+5x4+6x5+O(x6))ln(x)+1x22x33x44x5+O(x6))
Maple. Time used: 0.023 (sec). Leaf size: 60
Order:=6; 
ode:=x*(x-1)*diff(diff(y(x),x),x)+3*diff(y(x),x)*x+y(x) = 0; 
dsolve(ode,y(x),type='series',x=0);
 
y=c1x(1+2x+3x2+4x3+5x4+6x5+O(x6))+(x+2x2+3x3+4x4+5x5+O(x6))ln(x)c2+(1+3x+5x2+7x3+9x4+11x5+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)] 
<- linear_1 successful
 

Maple step by step

Let’s solvex(x1)(ddxddxy(x))+3x(ddxy(x))+y(x)=0Highest derivative means the order of the ODE is2ddxddxy(x)Isolate 2nd derivativeddxddxy(x)=y(x)x(x1)3(ddxy(x))x1Group terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearddxddxy(x)+3(ddxy(x))x1+y(x)x(x1)=0Check to see ifx0is a regular singular pointDefine functions[P2(x)=3x1,P3(x)=1x(x1)]xP2(x)is analytic atx=0(xP2(x))|x=0=0x2P3(x)is analytic atx=0(x2P3(x))|x=0=0x=0is a regular singular pointCheck to see ifx0is a regular singular pointx0=0Multiply by denominatorsx(x1)(ddxddxy(x))+3x(ddxy(x))+y(x)=0Assume series solution fory(x)y(x)=k=0akxk+rRewrite ODE with series expansionsConvertx(ddxy(x))to series expansionx(ddxy(x))=k=0ak(k+r)xk+rConvertxm(ddxddxy(x))to series expansion form=1..2xm(ddxddxy(x))=k=0ak(k+r)(k+r1)xk+r2+mShift index usingk>k+2mxm(ddxddxy(x))=k=2+mak+2m(k+2m+r)(k+1m+r)xk+rRewrite ODE with series expansionsa0r(1+r)x1+r+(k=0(ak+1(k+r+1)(k+r)+ak(k+r+1)2)xk+r)=0a0cannot be 0 by assumption, giving the indicial equationr(1+r)=0Values of r that satisfy the indicial equationr{0,1}Each term in the series must be 0, giving the recursion relation(k+r+1)(ak+1(k+r)+ak(k+r+1))=0Recursion relation that defines series solution to ODEak+1=ak(k+r+1)k+rRecursion relation forr=0ak+1=ak(k+1)kSolution forr=0[y(x)=k=0akxk,ak+1=ak(k+1)k]Recursion relation forr=1ak+1=ak(k+2)k+1Solution forr=1[y(x)=k=0akxk+1,ak+1=ak(k+2)k+1]Combine solutions and rename parameters[y(x)=(k=0akxk)+(k=0bkxk+1),ak+1=ak(k+1)k,bk+1=bk(k+2)k+1]
Mathematica. Time used: 0.044 (sec). Leaf size: 63
ode=x*(x-1)*D[y[x],{x,2}] +3*x*D[y[x],x]+y[x] == 0; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)c1(x4+x3+x2+(4x3+3x2+2x+1)xlog(x)+x+1)+c2(5x5+4x4+3x3+2x2+x)
Sympy. Time used: 0.901 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(x - 1)*Derivative(y(x), (x, 2)) + 3*x*Derivative(y(x), x) + y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
y(x)=C2x(27x4409x38+3x223x2+1)+C1+O(x6)