2.15 problem 15

2.15.1 Existence and uniqueness analysis
2.15.2 Solving as linear ode
2.15.3 Maple step by step solution

Internal problem ID [5101]
Internal file name [OUTPUT/4594_Sunday_June_05_2022_03_01_30_PM_42109241/index.tex]

Book: Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section: Program 24. First order differential equations. Further problems 24. page 1068
Problem number: 15.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "exact", "linear", "first_order_ode_lie_symmetry_lookup"

Maple gives the following as the ode type

[_linear]

\[ \boxed {y^{\prime }+y \cot \left (x \right )=5 \,{\mathrm e}^{\cos \left (x \right )}} \] With initial conditions \begin {align*} \left [y \left (\frac {\pi }{2}\right ) = -4\right ] \end {align*}

2.15.1 Existence and uniqueness analysis

This is a linear ODE. In canonical form it is written as \begin {align*} y^{\prime } + p(x)y &= q(x) \end {align*}

Where here \begin {align*} p(x) &=\cot \left (x \right )\\ q(x) &=5 \,{\mathrm e}^{\cos \left (x \right )} \end {align*}

Hence the ode is \begin {align*} y^{\prime }+y \cot \left (x \right ) = 5 \,{\mathrm e}^{\cos \left (x \right )} \end {align*}

The domain of \(p(x)=\cot \left (x \right )\) is \[ \{x <\pi \_Z61 \boldsymbol {\lor }\pi \_Z61

2.15.2 Solving as linear ode

Entering Linear first order ODE solver. The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int \cot \left (x \right )d x} \\ &= \sin \left (x \right ) \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (5 \,{\mathrm e}^{\cos \left (x \right )}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\sin \left (x \right ) y\right ) &= \left (\sin \left (x \right )\right ) \left (5 \,{\mathrm e}^{\cos \left (x \right )}\right )\\ \mathrm {d} \left (\sin \left (x \right ) y\right ) &= \left (5 \,{\mathrm e}^{\cos \left (x \right )} \sin \left (x \right )\right )\, \mathrm {d} x \end {align*}

Integrating gives \begin {align*} \sin \left (x \right ) y &= \int {5 \,{\mathrm e}^{\cos \left (x \right )} \sin \left (x \right )\,\mathrm {d} x}\\ \sin \left (x \right ) y &= -5 \,{\mathrm e}^{\cos \left (x \right )} + c_{1} \end {align*}

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

which simplifies to \begin {align*} y &= \csc \left (x \right ) \left (-5 \,{\mathrm e}^{\cos \left (x \right )}+c_{1} \right ) \end {align*}

Initial conditions are used to solve for \(c_{1}\). Substituting \(x=\frac {\pi }{2}\) and \(y=-4\) in the above solution gives an equation to solve for the constant of integration. \begin {align*} -4 = -5+c_{1} \end {align*}

The solutions are \begin {align*} c_{1} = 1 \end {align*}

Trying the constant \begin {align*} c_{1} = 1 \end {align*}

Substituting this in the general solution gives \begin {align*} y&=-5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \end {align*}

The constant \(c_{1} = 1\) gives valid solution.

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= -5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \\ \end{align*}

(a) Solution plot

(b) Slope field plot

Verification of solutions

\[ y = -5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \] Verified OK.

2.15.3 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }+y \cot \left (x \right )=5 \,{\mathrm e}^{\cos \left (x \right )}, y \left (\frac {\pi }{2}\right )=-4\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 }=-y \cot \left (x \right )+5 \,{\mathrm e}^{\cos \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 }+y \cot \left (x \right )=5 \,{\mathrm e}^{\cos \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 }+y \cot \left (x \right )\right )=5 \mu \left (x \right ) {\mathrm e}^{\cos \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 }+y \cot \left (x \right )\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 ) \cot \left (x \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (x \right )=\sin \left (x \right ) \\ \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 5 \mu \left (x \right ) {\mathrm e}^{\cos \left (x \right )}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & y \mu \left (x \right )=\int 5 \mu \left (x \right ) {\mathrm e}^{\cos \left (x \right )}d x +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\frac {\int 5 \mu \left (x \right ) {\mathrm e}^{\cos \left (x \right )}d x +c_{1}}{\mu \left (x \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (x \right )=\sin \left (x \right ) \\ {} & {} & y=\frac {\int 5 \,{\mathrm e}^{\cos \left (x \right )} \sin \left (x \right )d x +c_{1}}{\sin \left (x \right )} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & y=\frac {-5 \,{\mathrm e}^{\cos \left (x \right )}+c_{1}}{\sin \left (x \right )} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & y=\csc \left (x \right ) \left (-5 \,{\mathrm e}^{\cos \left (x \right )}+c_{1} \right ) \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (\frac {\pi }{2}\right )=-4 \\ {} & {} & -4=-5+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} c_{1} \\ {} & {} & c_{1} =1 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} c_{1} =1\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=-5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=-5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \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.016 (sec). Leaf size: 14

dsolve([diff(y(x),x)+y(x)*cot(x)=5*exp(cos(x)),y(1/2*Pi) = -4],y(x), singsol=all)
 

\[ y \left (x \right ) = -5 \,{\mathrm e}^{\cos \left (x \right )} \csc \left (x \right )+\csc \left (x \right ) \]

Solution by Mathematica

Time used: 0.1 (sec). Leaf size: 16

DSolve[{y'[x]+y[x]*Cot[x]==5*Exp[Cos[x]],{y[Pi/2]==-4}},y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to \left (1-5 e^{\cos (x)}\right ) \csc (x) \]