2.5.8 Problem 8

Maple
Mathematica
Sympy

Internal problem ID [8969]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 8
Date solved : Wednesday, March 05, 2025 at 07:13:25 AM
CAS classification : [[_linear, `class A`]]

Solve

y+y=1x2

Using series expansion around x=0

Since this is an inhomogeneous, then let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ode y+y=0,and yp is a particular solution to the inhomogeneous ode. 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+r1

Substituting the above back into the ode gives

(1)(n=0(n+r)anxn+r1)+(n=0anxn+r)=0

Which simplifies to

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

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

(n+r)anxn+r1=0

When n=0 the above becomes

ra0x1+r=0

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

mc0x1+m=1x2

This equation will used later to find the particular solution.

Since a00 then the indicial equation becomes

rx1+r=0

Since the above is true for all x then the indicial equation simplifies to

r=0

Solving for r gives the root of the indicial equation as

r=0

For 1n, the recurrence equation is

(4)an(n+r)+an1=0

For n=1 the recurrence equation gives

a1(1+r)+a0=0

Which after substituting the earlier terms found becomes

a1=a01+r

For n=2 the recurrence equation gives

a2(2+r)+a1=0

Which after substituting the earlier terms found becomes

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

For n=3 the recurrence equation gives

a3(3+r)+a2=0

Which after substituting the earlier terms found becomes

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

For n=4 the recurrence equation gives

a4(4+r)+a3=0

Which after substituting the earlier terms found becomes

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

For n=5 the recurrence equation gives

a5(5+r)+a4=0

Which after substituting the earlier terms found becomes

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

And so on. Therefore the solution is

y=n=0anxn+r=a0xr+a1x1+r+a2x2+r+a3x3+r+

Substituting the values for an found above, the solution becomes

y=a0xra0x1+r1+r+a0x2+r(1+r)(2+r)a0x3+r(1+r)(2+r)(3+r)+a0x4+r(1+r)(2+r)(3+r)(4+r)a0x5+r(1+r)(2+r)(3+r)(4+r)(5+r)+

Which can be written as

y=xr(a0a0x1+r+a0x2(1+r)(2+r)a0x3(1+r)(2+r)(3+r)+a0x4(1+r)(2+r)(3+r)(4+r)a0x5(1+r)(2+r)(3+r)(4+r)(5+r)+O(x6)a0)

Collecting terms, the solution becomes

(3)y=xr(1x1+r+x2(1+r)(2+r)x3(1+r)(2+r)(3+r)+x4(1+r)(2+r)(3+r)(4+r)x5(1+r)(2+r)(3+r)(4+r)(5+r)+O(x6))a0

Finally, since r=0, then the solution becomes

(3)y=(1x+x22x36+x424x5120+O(x6))a0

Now we determine the particular solution yp by solving the balance equation

mc0x1+m=1x2

For c0 and x. This results in

c0=1m=1

The particular solution is therefore

yp=n=0cnxn+m=n=0cnxn+1

Where in the above c0=1. The remaining cn values are found using the same recurrence relation used to find the homogeneous solution but using c0 in place of a0 and using m=1 in place of the root of the indicial equation used to find the homogeneous solution. The following are the values of an found in terms of the indicial root r. These will be now used to find find cn by replacing a0=1 and r=1. The following table gives the an values found and the corresponding cn values which will be used to find the particular solution

n an cn
0 a0=1 c0=1

Unable to find particular solution .Unable to find the particular solution. No solution exist.

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

Maple trace

`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
<- 1st order linear successful`
 

Maple step by step

Let’s solveddxy(x)+y(x)=1x2Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)+1x2Group terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODEddxy(x)+y(x)=1x2The ODE is linear; multiply by an integrating factorμ(x)μ(x)(ddxy(x)+y(x))=μ(x)x2Assume the lhs of the ODE is the total derivativeddx(y(x)μ(x))μ(x)(ddxy(x)+y(x))=(ddxy(x))μ(x)+y(x)(ddxμ(x))Isolateddxμ(x)ddxμ(x)=μ(x)Solve to find the integrating factorμ(x)=exIntegrate both sides with respect tox(ddx(y(x)μ(x)))dx=μ(x)x2dx+C1Evaluate the integral on the lhsy(x)μ(x)=μ(x)x2dx+C1Solve fory(x)y(x)=μ(x)x2dx+C1μ(x)Substituteμ(x)=exy(x)=exx2dx+C1exEvaluate the integrals on the rhsy(x)=exxEi1(x)+C1exSimplifyy(x)=C1xexexEi1(x)x1x
Mathematica. Time used: 0.014 (sec). Leaf size: 122
ode=D[y[x],x]+y[x]==1/x^2; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)(x5120+x424x36+x22x+1)(x62160+x51800+x4480+x372+x212+x21x+log(x))+c1(x5120+x424x36+x22x+1)
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), x) - 1/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="1st_power_series",x0=0,n=6)
 
ValueError : ODE y(x) + Derivative(y(x), x) - 1/x**2 does not match hint 1st_power_series