3.15 problem Problem 15

3.15.1 Solving as linear ode
3.15.2 Maple step by step solution

Internal problem ID [2653]
Internal file name [OUTPUT/2145_Sunday_June_05_2022_02_50_17_AM_4708840/index.tex]

Book: Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section: Chapter 1, First-Order Differential Equations. Section 1.6, First-Order Linear Differential Equations. page 59
Problem number: Problem 15.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program :

Maple gives the following as the ode type

[_linear]

\[ \boxed {y^{\prime }+\frac {m y}{x}=\ln \left (x \right )} \]

3.15.1 Solving as linear ode

Entering Linear first order ODE solver. In canonical form a linear first order is \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}

Where here \begin {align*} p(x) &=\frac {m}{x}\\ q(x) &=\ln \left (x \right ) \end {align*}

Hence the ode is \begin {align*} y^{\prime }+\frac {m y}{x} = \ln \left (x \right ) \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \frac {m}{x}d x} \\ &= {\mathrm e}^{m \ln \left (x \right )} \\ \end{align*} Which simplifies to \[ \mu = x^{m} \] The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\ln \left (x \right )\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (x^{m} y\right ) &= \left (x^{m}\right ) \left (\ln \left (x \right )\right )\\ \mathrm {d} \left (x^{m} y\right ) &= \left (\ln \left (x \right ) x^{m}\right )\, \mathrm {d} x \end {align*}

Integrating gives \begin {align*} x^{m} y &= \int {\ln \left (x \right ) x^{m}\,\mathrm {d} x}\\ x^{m} y &= \frac {x \ln \left (x \right ) {\mathrm e}^{m \ln \left (x \right )}}{m +1}-\frac {x \,{\mathrm e}^{m \ln \left (x \right )}}{m^{2}+2 m +1} + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu =x^{m}\) results in \begin {align*} y &= x^{-m} \left (\frac {x \ln \left (x \right ) {\mathrm e}^{m \ln \left (x \right )}}{m +1}-\frac {x \,{\mathrm e}^{m \ln \left (x \right )}}{m^{2}+2 m +1}\right )+c_{1} x^{-m} \end {align*}

which simplifies to \begin {align*} y &= \frac {c_{1} \left (m +1\right )^{2} x^{-m}+\left (-1+\left (m +1\right ) \ln \left (x \right )\right ) x}{\left (m +1\right )^{2}} \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \frac {c_{1} \left (m +1\right )^{2} x^{-m}+\left (-1+\left (m +1\right ) \ln \left (x \right )\right ) x}{\left (m +1\right )^{2}} \\ \end{align*}

Verification of solutions

\[ y = \frac {c_{1} \left (m +1\right )^{2} x^{-m}+\left (-1+\left (m +1\right ) \ln \left (x \right )\right ) x}{\left (m +1\right )^{2}} \] Verified OK.

3.15.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & y^{\prime }+\frac {m y}{x}=\ln \left (x \right ) \\ \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 }=-\frac {m y}{x}+\ln \left (x \right ) \\ \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 }+\frac {m y}{x}=\ln \left (x \right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (x \right ) \\ {} & {} & \mu \left (x \right ) \left (y^{\prime }+\frac {m y}{x}\right )=\mu \left (x \right ) \ln \left (x \right ) \\ \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 }+\frac {m y}{x}\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 )=\frac {\mu \left (x \right ) m}{x} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )=x^{m} \\ \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 \mu \left (x \right ) \ln \left (x \right )d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int \mu \left (x \right ) \ln \left (x \right )d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int \mu \left (x \right ) \ln \left (x \right )d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )=x^{m} \\ {} & {} & y=\frac {\int \ln \left (x \right ) x^{m}d x +c_{1}}{x^{m}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {\frac {x \ln \left (x \right ) {\mathrm e}^{m \ln \left (x \right )}}{m +1}-\frac {x \,{\mathrm e}^{m \ln \left (x \right )}}{m^{2}+2 m +1}+c_{1}}{x^{m}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\frac {c_{1} \left (m +1\right )^{2} x^{-m}+\left (-1+\left (m +1\right ) \ln \left (x \right )\right ) x}{\left (m +1\right )^{2}} \end {array} \]

Maple trace

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

Solution by Maple

Time used: 0.0 (sec). Leaf size: 33

dsolve(diff(y(x),x)+m/x*y(x)=ln(x),y(x), singsol=all)
 

\[ y \left (x \right ) = \frac {c_{1} \left (m +1\right )^{2} x^{-m}+x \left (-1+\left (m +1\right ) \ln \left (x \right )\right )}{\left (m +1\right )^{2}} \]

Solution by Mathematica

Time used: 0.051 (sec). Leaf size: 29

DSolve[y'[x]+m/x*y[x]==Log[x],y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \frac {x ((m+1) \log (x)-1)}{(m+1)^2}+c_1 x^{-m} \]