5.8 problem 8

5.8.1 Maple step by step solution
5.8.2 Maple trace
5.8.3 Maple dsolve solution
5.8.4 Mathematica DSolve solution

Internal problem ID [7949]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 8
Date solved : Monday, October 21, 2024 at 04:39:22 PM
CAS classification : [[_linear, `class A`]]

Solve

\begin{align*} y^{\prime }+y&=\frac {1}{x^{2}} \end{align*}

Using series expansion around \(x=0\)

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 }+y = 0\),and \(y_p\) is a particular solution to the inhomogeneous ode. 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} \end{align*}

Substituting the above back into the ode gives

\begin{align*} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) a_{n} x^{n +r -1}\right )+\left (\moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r}\right ) = 0\tag {1} \end{align*}

Which simplifies to

\begin{equation} \tag{2A} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) a_{n} x^{n +r -1}\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 -1\) in each summation term. Going over each summation term above with power of \(x\) in it which is not already \(x^{n +r -1}\) 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 =1}{\sum }}a_{n -1} x^{n +r -1} \\ \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 -1\).

\begin{equation} \tag{2B} \left (\moverset {\infty }{\munderset {n =0}{\sum }}\left (n +r \right ) a_{n} x^{n +r -1}\right )+\left (\moverset {\infty }{\munderset {n =1}{\sum }}a_{n -1} x^{n +r -1}\right ) = 0 \end{equation}

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

\[ \left (n +r \right ) a_{n} x^{n +r -1} = 0 \]

When \(n=0\) the above becomes

\[ r a_{0} x^{-1+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

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

This equation will used later to find the particular solution.

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

\[ r \,x^{-1+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 \(1\le n\), the recurrence equation is

\begin{equation} \tag{4} a_{n} \left (n +r \right )+a_{n -1} = 0 \end{equation}

For \(n = 1\) the recurrence equation gives

\[ a_{1} \left (1+r \right )+a_{0} = 0 \]

Which after substituting the earlier terms found becomes

\[ a_{1} = -\frac {a_{0}}{1+r} \]

For \(n = 2\) the recurrence equation gives

\[ a_{2} \left (2+r \right )+a_{1} = 0 \]

Which after substituting the earlier terms found becomes

\[ a_{2} = \frac {a_{0}}{\left (1+r \right ) \left (2+r \right )} \]

For \(n = 3\) the recurrence equation gives

\[ a_{3} \left (3+r \right )+a_{2} = 0 \]

Which after substituting the earlier terms found becomes

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

For \(n = 4\) the recurrence equation gives

\[ a_{4} \left (4+r \right )+a_{3} = 0 \]

Which after substituting the earlier terms found becomes

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

For \(n = 5\) the recurrence equation gives

\[ a_{5} \left (5+r \right )+a_{4} = 0 \]

Which after substituting the earlier terms found becomes

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

And so on. Therefore the solution is

\begin{align*} y &= \moverset {\infty }{\munderset {n =0}{\sum }}a_{n} x^{n +r}\\ &= a_{0} x^{r}+a_{1} x^{1+r}+a_{2} x^{2+r}+a_{3} x^{3+r} + \dots \end{align*}

Substituting the values for \(a_{n}\) found above, the solution becomes

\[ y = a_{0} x^{r}-\frac {a_{0} x^{1+r}}{1+r}+\frac {a_{0} x^{2+r}}{\left (1+r \right ) \left (2+r \right )}-\frac {a_{0} x^{3+r}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right )}+\frac {a_{0} x^{4+r}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right )}-\frac {a_{0} x^{5+r}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right ) \left (5+r \right )}+\dots \]

Which can be written as

\[ y = x^{r} \left (a_{0}-\frac {a_{0} x}{1+r}+\frac {a_{0} x^{2}}{\left (1+r \right ) \left (2+r \right )}-\frac {a_{0} x^{3}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right )}+\frac {a_{0} x^{4}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right )}-\frac {a_{0} x^{5}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right ) \left (5+r \right )}+O\left (x^{6}\right ) a_{0}\right ) \]

Collecting terms, the solution becomes

\begin{align*} y = x^{r} \left (1-\frac {x}{1+r}+\frac {x^{2}}{\left (1+r \right ) \left (2+r \right )}-\frac {x^{3}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right )}+\frac {x^{4}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right )}-\frac {x^{5}}{\left (1+r \right ) \left (2+r \right ) \left (3+r \right ) \left (4+r \right ) \left (5+r \right )}+O\left (x^{6}\right )\right ) a_{0}\tag {3} \end{align*}

Finally, since \(r = 0\), then the solution becomes

\begin{gather*} y = \left (1-x +\frac {x^{2}}{2}-\frac {x^{3}}{6}+\frac {x^{4}}{24}-\frac {x^{5}}{120}+O\left (x^{6}\right )\right ) a_{0}\tag {3} \end{gather*}

Now we determine the particular solution \(y_p\) by solving the balance equation

\[ m c_{0} x^{-1+m} = \frac {1}{x^{2}} \]

For \(c_{0}\) and \(x\). This results in

\begin{align*} c_{0}&=-1\\ m&=-1 \end{align*}

The particular solution is therefore

\begin{align*} y_p &= \sum _{n=0}^{\infty } c_n x^{n+m}\\ &= \sum _{n=0}^{\infty } c_n x^{n+-1} \end{align*}

Where in the above \(c_0 = -1\). The remaining \(c_n\) values are found using the same recurrence relation used to find the homogeneous solution but using \(c_0\) in place of \(a_{0}\) 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 \(a_n\) found in terms of the indicial root \(r\). These will be now used to find find \(c_n\) by replacing \(a_{0} = -1\) and \(r=-1\). The following table gives the \(a_n\) values found and the corresponding \(c_n\) values which will be used to find the particular solution

\(n\) \(a_n\) \(c_n\)
\(0\) \(a_{0} = 1\) \(c_{0} = -1\)

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

5.8.1 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }+y=\frac {1}{x^{2}} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=-y+\frac {1}{x^{2}} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} y\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & y^{\prime }+y=\frac {1}{x^{2}} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+y\right )=\frac {\mu \left (x \right )}{x^{2}} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d x}\left (y \mu \left (x \right )\right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+y\right )=y^{\prime } \mu \left (x \right )+y \mu ^{\prime }\left (x \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (x \right ) \\ {} & {} & \mu ^{\prime }\left (x \right )=\mu \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )={\mathrm e}^{x} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \left (\frac {d}{d x}\left (y \mu \left (x \right )\right )\right )d x =\int \frac {\mu \left (x \right )}{x^{2}}d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \frac {\mu \left (x \right )}{x^{2}}d x +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \frac {\mu \left (x \right )}{x^{2}}d x +\mathit {C1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )={\mathrm e}^{x} \\ {} & {} & y=\frac {\int \frac {{\mathrm e}^{x}}{x^{2}}d x +\mathit {C1}}{{\mathrm e}^{x}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {-\frac {{\mathrm e}^{x}}{x}-\mathrm {Ei}_{1}\left (-x \right )+\mathit {C1}}{{\mathrm e}^{x}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\frac {\mathit {C1} x \,{\mathrm e}^{-x}-\mathrm {Ei}_{1}\left (-x \right ) x \,{\mathrm e}^{-x}-1}{x} \end {array} \]

5.8.2 Maple trace
Methods for first order ODEs:
 
5.8.3 Maple dsolve solution

Solving time : 0.019 (sec)
Leaf size : maple_leaf_size

dsolve(diff(y(x),x)+y(x) = 1/x^2,y(x), 
       series,x=0)
 
\[ \text {No solution found} \]
5.8.4 Mathematica DSolve solution

Solving time : 0.015 (sec)
Leaf size : 122

AsymptoticDSolveValue[{D[y[x],x]+y[x]==1/x^2,{}}, 
       y[x],{x,0,5}]
 
\[ y(x)\to \left (-\frac {x^5}{120}+\frac {x^4}{24}-\frac {x^3}{6}+\frac {x^2}{2}-x+1\right ) \left (\frac {x^6}{2160}+\frac {x^5}{1800}+\frac {x^4}{480}+\frac {x^3}{72}+\frac {x^2}{12}+\frac {x}{2}-\frac {1}{x}+\log (x)\right )+c_1 \left (-\frac {x^5}{120}+\frac {x^4}{24}-\frac {x^3}{6}+\frac {x^2}{2}-x+1\right ) \]