3.10 problem Problem 10

3.10.1 Solving as linear ode
3.10.2 Maple step by step solution

Internal problem ID [2648]
Internal file name [OUTPUT/2140_Sunday_June_05_2022_02_50_06_AM_138995/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 10.
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 {t x^{\prime }+2 x=4 \,{\mathrm e}^{t}} \]

3.10.1 Solving as linear ode

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

Where here \begin {align*} p(t) &=\frac {2}{t}\\ q(t) &=\frac {4 \,{\mathrm e}^{t}}{t} \end {align*}

Hence the ode is \begin {align*} x^{\prime }+\frac {2 x}{t} = \frac {4 \,{\mathrm e}^{t}}{t} \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \frac {2}{t}d t} \\ &= t^{2} \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}}\left ( \mu x\right ) &= \left (\mu \right ) \left (\frac {4 \,{\mathrm e}^{t}}{t}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}t}} \left (t^{2} x\right ) &= \left (t^{2}\right ) \left (\frac {4 \,{\mathrm e}^{t}}{t}\right )\\ \mathrm {d} \left (t^{2} x\right ) &= \left (4 t \,{\mathrm e}^{t}\right )\, \mathrm {d} t \end {align*}

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

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

which simplifies to \begin {align*} x &= \frac {\left (4 t -4\right ) {\mathrm e}^{t}+c_{1}}{t^{2}} \end {align*}

Summary

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

Figure 66: Slope field plot

Verification of solutions

\[ x = \frac {\left (4 t -4\right ) {\mathrm e}^{t}+c_{1}}{t^{2}} \] Verified OK.

3.10.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & t x^{\prime }+2 x=4 \,{\mathrm e}^{t} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & x^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & x^{\prime }=\frac {-2 x+4 \,{\mathrm e}^{t}}{t} \\ \bullet & {} & \textrm {Collect w.r.t.}\hspace {3pt} x\hspace {3pt}\textrm {and simplify}\hspace {3pt} \\ {} & {} & x^{\prime }=-\frac {2 x}{t}+\frac {4 \,{\mathrm e}^{t}}{t} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} x\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & x^{\prime }+\frac {2 x}{t}=\frac {4 \,{\mathrm e}^{t}}{t} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (t \right ) \\ {} & {} & \mu \left (t \right ) \left (x^{\prime }+\frac {2 x}{t}\right )=\frac {4 \mu \left (t \right ) {\mathrm e}^{t}}{t} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d t}\left (x \mu \left (t \right )\right ) \\ {} & {} & \mu \left (t \right ) \left (x^{\prime }+\frac {2 x}{t}\right )=x^{\prime } \mu \left (t \right )+x \mu ^{\prime }\left (t \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (t \right ) \\ {} & {} & \mu ^{\prime }\left (t \right )=\frac {2 \mu \left (t \right )}{t} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (t \right )=t^{2} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \left (\frac {d}{d t}\left (x \mu \left (t \right )\right )\right )d t =\int \frac {4 \mu \left (t \right ) {\mathrm e}^{t}}{t}d t +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & x \mu \left (t \right )=\int \frac {4 \mu \left (t \right ) {\mathrm e}^{t}}{t}d t +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} x \\ {} & {} & x=\frac {\int \frac {4 \mu \left (t \right ) {\mathrm e}^{t}}{t}d t +c_{1}}{\mu \left (t \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (t \right )=t^{2} \\ {} & {} & x=\frac {\int 4 t \,{\mathrm e}^{t}d t +c_{1}}{t^{2}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & x=\frac {4 \left (t -1\right ) {\mathrm e}^{t}+c_{1}}{t^{2}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & x=\frac {\left (4 t -4\right ) {\mathrm e}^{t}+c_{1}}{t^{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: 18

dsolve(t*diff(x(t),t)+2*x(t)=4*exp(t),x(t), singsol=all)
 

\[ x \left (t \right ) = \frac {\left (4 t -4\right ) {\mathrm e}^{t}+c_{1}}{t^{2}} \]

Solution by Mathematica

Time used: 0.049 (sec). Leaf size: 20

DSolve[t*x'[t]+2*x[t]==4*Exp[t],x[t],t,IncludeSingularSolutions -> True]
 

\[ x(t)\to \frac {4 e^t (t-1)+c_1}{t^2} \]