2.5.13 Problem 13

Maple
Mathematica
Sympy

Internal problem ID [10248]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 13
Date solved : Thursday, November 27, 2025 at 10:27:43 AM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+y&=\frac {1}{x} \\ \end{align*}
Series expansion around \(x=0\).
\begin{align*} y^{\prime \prime }+y&=\frac {1}{x} \\ \end{align*}
Series expansion around \(x=0\).

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

\[ y^{\prime \prime }+y = 0 \]
The following is summary of singularities for the above ode. Writing the ode as
\begin{align*} y^{\prime \prime }+p(x) y^{\prime } + q(x) y &=0 \end{align*}

Where

\begin{align*} p(x) &= 0\\ q(x) &= 1\\ \end{align*}
Table 2.123: Table \(p(x),q(x)\) singularites.
\(p(x)=0\)
singularity type
\(q(x)=1\)
singularity type

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

Regular singular points : \([]\)

Irregular singular points : \([\infty ]\)

Since \(x = 0\) is regular singular point, then Frobenius power series is used. Since this is an inhomogeneous, then let the solution be

\[ y = y_h + y_p \]
Where \(y_h\) is the solution to the homogeneous ode \(y^{\prime \prime }+y = 0\), and \(y_p\) is a particular solution to the inhomogeneous ode.which is found using the balance equation generated from indicial equation

First, we solve for \(y_h\) Let the solution be represented as Frobenius power series of the form

\[ y = \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r} \]
Then
\begin{align*} y^{\prime } &= \moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) a_{n} x^{n +r -1} \\ y^{\prime \prime } &= \moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) \left (n +r -1\right ) a_{n} x^{n +r -2} \\ \end{align*}
Substituting the above back into the ode gives
\begin{equation} \tag{1} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) \left (n +r -1\right ) a_{n} x^{n +r -2}\right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r}\right ) = 0 \end{equation}
Which simplifies to
\begin{equation} \tag{2A} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) \left (n +r -1\right ) a_{n} x^{n +r -2}\right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r}\right ) = 0 \end{equation}
The next step is to make all powers of \(x\) be \(n +r -2\) in each summation term. Going over each summation term above with power of \(x\) in it which is not already \(x^{n +r -2}\) and adjusting the power and the corresponding index gives
\begin{align*} \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r} &= \moverset {\infty }{\munderset {n =2}{\sum }}a_{n -2} x^{n +r -2} \\ \end{align*}
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 -2\).
\begin{equation} \tag{2B} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) \left (n +r -1\right ) a_{n} x^{n +r -2}\right )+\left (\moverset {\infty }{\munderset {n =2}{\sum }}a_{n -2} x^{n +r -2}\right ) = 0 \end{equation}
The indicial equation is obtained from \(n = 0\). From Eq (2B) this gives
\[ \left (n +r \right ) \left (n +r -1\right ) a_{n} x^{n +r -2} = 0 \]
When \(n = 0\) the above becomes
\[ r \left (-1+r \right ) a_{0} x^{-2+r} = 0 \]
Or
\[ r \left (-1+r \right ) a_{0} x^{-2+r} = 0 \]
Since \(a_{0}\neq 0\) then the above simplifies to
\[ r \left (-1+r \right ) x^{-2+r} = 0 \]
Since the above is true for all \(x\) then the indicial equation becomes
\[ r \left (-1+r \right ) = 0 \]
Solving for \(r\) gives the roots of the indicial equation as
\begin{align*} r_1 &= 1\\ r_2 &= 0 \end{align*}

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

\begin{align*}m \left (-1+m \right ) c_{0} x^{-2+m} = \frac {1}{x} \end{align*}

This equation will used later to find the particular solution.

Since \(a_{0}\neq 0\) then the indicial equation becomes

\[ r \left (-1+r \right ) x^{-2+r} = 0 \]
Solving for \(r\) gives the roots of the indicial equation as \([1, 0]\).

Since \(r_1 - r_2 = 1\) is an integer, then we can construct two linearly independent solutions

\begin{align*} y_{1}\left (x \right ) &= x^{r_{1}} \left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n}\right )\\ y_{2}\left (x \right ) &= C y_{1}\left (x \right ) \ln \left (x \right )+x^{r_{2}} \left (\moverset {\infty }{\munderset {n =0}{\sum }}b_{n} x^{n}\right ) \end{align*}

Or

\begin{align*} y_{1}\left (x \right ) &= x \left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n}\right )\\ y_{2}\left (x \right ) &= C y_{1}\left (x \right ) \ln \left (x \right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}b_{n} x^{n}\right ) \end{align*}

Or

\begin{align*} y_{1}\left (x \right ) &= \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +1}\\ y_{2}\left (x \right ) &= C y_{1}\left (x \right ) \ln \left (x \right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}b_{n} x^{n}\right ) \end{align*}

Where \(C\) above can be zero. We start by finding \(y_{1}\). Eq (2B) derived above is now used to find all \(a_{n}\) coefficients. The case \(n = 0\) is skipped since it was used to find the roots of the indicial equation. \(a_{0}\) is arbitrary and taken as \(a_{0} = 1\). Substituting \(n = 1\) in Eq. (2B) gives

\[ a_{1} = 0 \]
For \(2\le n\) the recursive equation is
\begin{equation} \tag{3} a_{n} \left (n +r \right ) \left (n +r -1\right )+a_{n -2} = 0 \end{equation}
Solving for \(a_{n}\) from recursive equation (4) gives
\[ a_{n} = -\frac {a_{n -2}}{\left (n +r \right ) \left (n +r -1\right )}\tag {4} \]
Which for the root \(r = 1\) becomes
\[ a_{n} = -\frac {a_{n -2}}{\left (n +1\right ) n}\tag {5} \]
At this point, it is a good idea to keep track of \(a_{n}\) in a table both before substituting \(r = 1\) and after as more terms are found using the above recursive equation.
\(n\) \(a_{n ,r}\) \(a_{n}\)
\(a_{0}\) \(1\) \(1\)
\(a_{1}\) \(0\) \(0\)

For \(n = 2\), using the above recursive equation gives

\[ a_{2}=-\frac {1}{r^{2}+3 r +2} \]
Which for the root \(r = 1\) becomes
\[ a_{2}=-{\frac {1}{6}} \]
And the table now becomes
\(n\) \(a_{n ,r}\) \(a_{n}\)
\(a_{0}\) \(1\) \(1\)
\(a_{1}\) \(0\) \(0\)
\(a_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{6}}\)

For \(n = 3\), using the above recursive equation gives

\[ a_{3}=0 \]
And the table now becomes
\(n\) \(a_{n ,r}\) \(a_{n}\)
\(a_{0}\) \(1\) \(1\)
\(a_{1}\) \(0\) \(0\)
\(a_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{6}}\)
\(a_{3}\) \(0\) \(0\)

For \(n = 4\), using the above recursive equation gives

\[ a_{4}=\frac {1}{r^{4}+10 r^{3}+35 r^{2}+50 r +24} \]
Which for the root \(r = 1\) becomes
\[ a_{4}={\frac {1}{120}} \]
And the table now becomes
\(n\) \(a_{n ,r}\) \(a_{n}\)
\(a_{0}\) \(1\) \(1\)
\(a_{1}\) \(0\) \(0\)
\(a_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{6}}\)
\(a_{3}\) \(0\) \(0\)
\(a_{4}\) \(\frac {1}{r^{4}+10 r^{3}+35 r^{2}+50 r +24}\) \(\frac {1}{120}\)

For \(n = 5\), using the above recursive equation gives

\[ a_{5}=0 \]
And the table now becomes
\(n\) \(a_{n ,r}\) \(a_{n}\)
\(a_{0}\) \(1\) \(1\)
\(a_{1}\) \(0\) \(0\)
\(a_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{6}}\)
\(a_{3}\) \(0\) \(0\)
\(a_{4}\) \(\frac {1}{r^{4}+10 r^{3}+35 r^{2}+50 r +24}\) \(\frac {1}{120}\)
\(a_{5}\) \(0\) \(0\)

Using the above table, then the solution \(y_{1}\left (x \right )\) is

\begin{align*} y_{1}\left (x \right )&= x \left (a_{0}+a_{1} x +a_{2} x^{2}+a_{3} x^{3}+a_{4} x^{4}+a_{5} x^{5}+a_{6} x^{6}\dots \right ) \\ &= x \left (1-\frac {x^{2}}{6}+\frac {x^{4}}{120}+O\left (x^{6}\right )\right ) \end{align*}

Now the second solution \(y_{2}\left (x \right )\) is found. Let

\[ r_{1}-r_{2} = N \]
Where \(N\) is positive integer which is the difference between the two roots. \(r_{1}\) 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 \(\lim _{r\rightarrow r_{2}}a_{1}\left (r \right )\). If this limit exists, then \(C = 0\), else we need to keep the log term and \(C \neq 0\). The above table shows that
\begin{align*} a_N &= a_{1} \\ &= 0 \end{align*}

Therefore

\begin{align*} \lim _{r\rightarrow r_{2}}0&= \lim _{r\rightarrow 0}0\\ &= 0 \end{align*}

The limit is \(0\). Since the limit exists then the log term is not needed and we can set \(C = 0\). Therefore the second solution has the form

\begin{align*} y_{2}\left (x \right ) &= \moverset {\infty }{\munderset {n =0}{\sum }}b_{n} x^{n +r}\\ &= \moverset {\infty }{\munderset {n =0}{\sum }}b_{n} x^{n} \end{align*}

Eq (3) derived above is used to find all \(b_{n}\) coefficients. The case \(n = 0\) is skipped since it was used to find the roots of the indicial equation. \(b_{0}\) is arbitrary and taken as \(b_{0} = 1\). Substituting \(n = 1\) in Eq(3) gives

\[ b_{1} = 0 \]
For \(2\le n\) the recursive equation is
\begin{equation} \tag{4} \left (n +r \right ) \left (n +r -1\right ) b_{n}+b_{n -2} = 0 \end{equation}
Which for for the root \(r = 0\) becomes
\begin{equation} \tag{4A} n \left (n -1\right ) b_{n}+b_{n -2} = 0 \end{equation}
Solving for \(b_{n}\) from the recursive equation (4) gives
\[ b_{n} = -\frac {b_{n -2}}{\left (n +r \right ) \left (n +r -1\right )}\tag {5} \]
Which for the root \(r = 0\) becomes
\[ b_{n} = -\frac {b_{n -2}}{n \left (n -1\right )}\tag {6} \]
At this point, it is a good idea to keep track of \(b_{n}\) in a table both before substituting \(r = 0\) and after as more terms are found using the above recursive equation.
\(n\) \(b_{n ,r}\) \(b_{n}\)
\(b_{0}\) \(1\) \(1\)
\(b_{1}\) \(0\) \(0\)

For \(n = 2\), using the above recursive equation gives

\[ b_{2}=-\frac {1}{r^{2}+3 r +2} \]
Which for the root \(r = 0\) becomes
\[ b_{2}=-{\frac {1}{2}} \]
And the table now becomes
\(n\) \(b_{n ,r}\) \(b_{n}\)
\(b_{0}\) \(1\) \(1\)
\(b_{1}\) \(0\) \(0\)
\(b_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{2}}\)

For \(n = 3\), using the above recursive equation gives

\[ b_{3}=0 \]
And the table now becomes
\(n\) \(b_{n ,r}\) \(b_{n}\)
\(b_{0}\) \(1\) \(1\)
\(b_{1}\) \(0\) \(0\)
\(b_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{2}}\)
\(b_{3}\) \(0\) \(0\)

For \(n = 4\), using the above recursive equation gives

\[ b_{4}=\frac {1}{\left (r^{2}+3 r +2\right ) \left (r^{2}+7 r +12\right )} \]
Which for the root \(r = 0\) becomes
\[ b_{4}={\frac {1}{24}} \]
And the table now becomes
\(n\) \(b_{n ,r}\) \(b_{n}\)
\(b_{0}\) \(1\) \(1\)
\(b_{1}\) \(0\) \(0\)
\(b_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{2}}\)
\(b_{3}\) \(0\) \(0\)
\(b_{4}\) \(\frac {1}{r^{4}+10 r^{3}+35 r^{2}+50 r +24}\) \(\frac {1}{24}\)

For \(n = 5\), using the above recursive equation gives

\[ b_{5}=0 \]
And the table now becomes
\(n\) \(b_{n ,r}\) \(b_{n}\)
\(b_{0}\) \(1\) \(1\)
\(b_{1}\) \(0\) \(0\)
\(b_{2}\) \(-\frac {1}{r^{2}+3 r +2}\) \(-{\frac {1}{2}}\)
\(b_{3}\) \(0\) \(0\)
\(b_{4}\) \(\frac {1}{r^{4}+10 r^{3}+35 r^{2}+50 r +24}\) \(\frac {1}{24}\)
\(b_{5}\) \(0\) \(0\)

Using the above table, then the solution \(y_{2}\left (x \right )\) is

\begin{align*} y_{2}\left (x \right )&= b_{0}+b_{1} x +b_{2} x^{2}+b_{3} x^{3}+b_{4} x^{4}+b_{5} x^{5}+b_{6} x^{6}\dots \\ &= 1-\frac {x^{2}}{2}+\frac {x^{4}}{24}+O\left (x^{6}\right ) \end{align*}

Therefore the homogeneous solution is

\begin{align*} y_h(x) &= c_1 y_{1}\left (x \right )+c_2 y_{2}\left (x \right ) \\ &= c_1 x \left (1-\frac {x^{2}}{6}+\frac {x^{4}}{120}+O\left (x^{6}\right )\right ) + c_2 \left (1-\frac {x^{2}}{2}+\frac {x^{4}}{24}+O\left (x^{6}\right )\right ) \\ \end{align*}
The particular solution is found by solving for \(c,m\) the balance equation
\begin{align*} m \left (-1+m \right ) c_{0} x^{-2+m}&=F \end{align*}

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 \(c_n,m\) for each term, the same recursive relation used to find \(y_h(x)\) is used to find \(c_n,m\) which is used to find the particular solution \(\sum _{n=0} c_n x^{n+m}\) by replacing \(a_n\) by \(c_n\) and \(r\) by \(m\).

The following are the values of \(a_n\) found in terms of the indicial root \(r\).

\(a_{1} = 0\)
\(a_{2} = -\frac {a_{0}}{\left (2+r \right ) \left (1+r \right )}\)
\(a_{3} = 0\)
\(a_{4} = \frac {a_{0}}{\left (2+r \right ) \left (1+r \right ) \left (4+r \right ) \left (3+r \right )}\)
\(a_{5} = 0\)

Unable to solve the balance equation \(m \left (-1+m \right ) c_{0} x^{-2+m}\) for \(c_{0}\) and \(x\). No particular solution exists.

Failed to convert RHS \(\frac {1}{x}\) 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:=diff(diff(y(x),x),x)+y(x) = 1/x; 
dsolve(ode,y(x),type='series',x=0);
 
\[ \text {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 
   <- constant coefficients successful 
<- solving first the homogeneous part of the ODE successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right )+y \left (x \right )=\frac {1}{x} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 2 \\ {} & {} & \frac {d^{2}}{d x^{2}}y \left (x \right ) \\ \bullet & {} & \textrm {Characteristic polynomial of homogeneous ODE}\hspace {3pt} \\ {} & {} & r^{2}+1=0 \\ \bullet & {} & \textrm {Use quadratic formula to solve for}\hspace {3pt} r \\ {} & {} & r =\frac {0\pm \left (\sqrt {-4}\right )}{2} \\ \bullet & {} & \textrm {Roots of the characteristic polynomial}\hspace {3pt} \\ {} & {} & r =\left (\mathrm {-I}, \mathrm {I}\right ) \\ \bullet & {} & \textrm {1st solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{1}\left (x \right )=\cos \left (x \right ) \\ \bullet & {} & \textrm {2nd solution of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y_{2}\left (x \right )=\sin \left (x \right ) \\ \bullet & {} & \textrm {General solution of the ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} y_{1}\left (x \right )+\mathit {C2} y_{2}\left (x \right )+y_{p}\left (x \right ) \\ \bullet & {} & \textrm {Substitute in solutions of the homogeneous ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} \cos \left (x \right )+\mathit {C2} \sin \left (x \right )+y_{p}\left (x \right ) \\ \square & {} & \textrm {Find a particular solution}\hspace {3pt} y_{p}\left (x \right )\hspace {3pt}\textrm {of the ODE}\hspace {3pt} \\ {} & \circ & \textrm {Use variation of parameters to find}\hspace {3pt} y_{p}\hspace {3pt}\textrm {here}\hspace {3pt} f \left (x \right )\hspace {3pt}\textrm {is the forcing function}\hspace {3pt} \\ {} & {} & \left [y_{p}\left (x \right )=-y_{1}\left (x \right ) \int \frac {y_{2}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x +y_{2}\left (x \right ) \int \frac {y_{1}\left (x \right ) f \left (x \right )}{W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )}d x , f \left (x \right )=\frac {1}{x}\right ] \\ {} & \circ & \textrm {Wronskian of solutions of the homogeneous equation}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=\left [\begin {array}{cc} \cos \left (x \right ) & \sin \left (x \right ) \\ -\sin \left (x \right ) & \cos \left (x \right ) \end {array}\right ] \\ {} & \circ & \textrm {Compute Wronskian}\hspace {3pt} \\ {} & {} & W \left (y_{1}\left (x \right ), y_{2}\left (x \right )\right )=1 \\ {} & \circ & \textrm {Substitute functions into equation for}\hspace {3pt} y_{p}\left (x \right ) \\ {} & {} & y_{p}\left (x \right )=-\cos \left (x \right ) \int \frac {\sin \left (x \right )}{x}d x +\sin \left (x \right ) \int \frac {\cos \left (x \right )}{x}d x \\ {} & \circ & \textrm {Compute integrals}\hspace {3pt} \\ {} & {} & y_{p}\left (x \right )=-\cos \left (x \right ) \mathrm {Si}\left (x \right )+\sin \left (x \right ) \mathrm {Ci}\left (x \right ) \\ \bullet & {} & \textrm {Substitute particular solution into general solution to ODE}\hspace {3pt} \\ {} & {} & y \left (x \right )=\mathit {C1} \cos \left (x \right )+\mathit {C2} \sin \left (x \right )-\cos \left (x \right ) \mathrm {Si}\left (x \right )+\sin \left (x \right ) \mathrm {Ci}\left (x \right ) \end {array} \]
Mathematica. Time used: 0.013 (sec). Leaf size: 148
ode=D[y[x],{x,2}]+y[x]==1/x; 
ic={}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
\[ y(x)\to x \left (-\frac {x^6}{5040}+\frac {x^4}{120}-\frac {x^2}{6}+1\right ) \left (-\frac {x^6}{4320}+\frac {x^4}{96}-\frac {x^2}{4}+\log (x)\right )+c_1 \left (-\frac {x^6}{720}+\frac {x^4}{24}-\frac {x^2}{2}+1\right )+c_2 x \left (-\frac {x^6}{5040}+\frac {x^4}{120}-\frac {x^2}{6}+1\right )+\left (-\frac {x^5}{600}+\frac {x^3}{18}-x\right ) \left (-\frac {x^6}{720}+\frac {x^4}{24}-\frac {x^2}{2}+1\right ) \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)) - 1/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
ValueError : ODE y(x) + Derivative(y(x), (x, 2)) - 1/x does not match hint 2nd_power_series_regular