2.5.7 problem 7

Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [8394]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 7
Date solved : Sunday, November 10, 2024 at 03:44:22 AM
CAS classification : [[_linear, `class A`]]

Solve

\begin{align*} y^{\prime }+y&=\frac {1}{x} \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} \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*}

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

Unable to find the particular solution. No solution exist.

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

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

Solving time : 0.036 (sec)
Leaf size : maple_leaf_size

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

Solving time : 0.017 (sec)
Leaf size : 113

AsymptoticDSolveValue[{D[y[x],x]+y[x]==1/x,{}}, 
       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}{600}+\frac {x^4}{96}+\frac {x^3}{18}+\frac {x^2}{4}+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 ) \]