2.5.7 Problem 7

Maple
Mathematica
Sympy

Internal problem ID [8968]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 7
Date solved : Sunday, March 30, 2025 at 01:57:33 PM
CAS classification : [[_linear, `class A`]]

Solve

y+y=1x

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=1x

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]

Unable to solve the balance equation mc0x1+m=1x for c0 and x. No particular solution exists.

Unable to find the particular solution. No solution exist.

Maple
Order:=6; 
ode:=diff(y(x),x)+y(x) = 1/x; 
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)=1xHighest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)+1xGroup terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODEddxy(x)+y(x)=1xThe ODE is linear; multiply by an integrating factorμ(x)μ(x)(ddxy(x)+y(x))=μ(x)xAssume 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)xdx+C1Evaluate the integral on the lhsy(x)μ(x)=μ(x)xdx+C1Solve fory(x)y(x)=μ(x)xdx+C1μ(x)Substituteμ(x)=exy(x)=exxdx+C1exEvaluate the integrals on the rhsy(x)=Ei1(x)+C1exSimplifyy(x)=ex(Ei1(x)+C1)
Mathematica. Time used: 0.014 (sec). Leaf size: 113
ode=D[y[x],x]+y[x]==1/x; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)(x5120+x424x36+x22x+1)(x62160+x5600+x496+x318+x24+x+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,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 does not match hint 1st_power_series