3.12 problem 12

3.12.1 Solving as linear ode
3.12.2 Maple step by step solution

Internal problem ID [4772]
Internal file name [OUTPUT/4265_Sunday_June_05_2022_12_50_02_PM_77883974/index.tex]

Book: Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section: Chapter 8, Ordinary differential equations. Section 3. Linear First-Order Equations. page 403
Problem number: 12.
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 {x^{\prime }+x \tan \left (y \right )=\cos \left (y \right )} \]

3.12.1 Solving as linear ode

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

Where here \begin {align*} p(y) &=\tan \left (y \right )\\ q(y) &=\cos \left (y \right ) \end {align*}

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

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

Integrating gives \begin {align*} \sec \left (y \right ) x &= \int {\mathrm {d} y}\\ \sec \left (y \right ) x &= y + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu =\sec \left (y \right )\) results in \begin {align*} x &= \cos \left (y \right ) y +c_{1} \cos \left (y \right ) \end {align*}

which simplifies to \begin {align*} x &= \cos \left (y \right ) \left (y +c_{1} \right ) \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} x &= \cos \left (y \right ) \left (y +c_{1} \right ) \\ \end{align*}

Figure 13: Slope field plot

Verification of solutions

\[ x = \cos \left (y \right ) \left (y +c_{1} \right ) \] Verified OK.

3.12.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x^{\prime }+x \tan \left (y \right )=\cos \left (y \right ) \\ \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 }=\cos \left (y \right )-x \tan \left (y \right ) \\ \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 }+x \tan \left (y \right )=\cos \left (y \right ) \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (y \right ) \\ {} & {} & \mu \left (y \right ) \left (x^{\prime }+x \tan \left (y \right )\right )=\mu \left (y \right ) \cos \left (y \right ) \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d y}\left (x \mu \left (y \right )\right ) \\ {} & {} & \mu \left (y \right ) \left (x^{\prime }+x \tan \left (y \right )\right )=x^{\prime } \mu \left (y \right )+x \mu ^{\prime }\left (y \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (y \right ) \\ {} & {} & \mu ^{\prime }\left (y \right )=\mu \left (y \right ) \tan \left (y \right ) \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (y \right )=\frac {1}{\cos \left (y \right )} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} y \\ {} & {} & \int \left (\frac {d}{d y}\left (x \mu \left (y \right )\right )\right )d y =\int \mu \left (y \right ) \cos \left (y \right )d y +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & x \mu \left (y \right )=\int \mu \left (y \right ) \cos \left (y \right )d y +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} x \\ {} & {} & x=\frac {\int \mu \left (y \right ) \cos \left (y \right )d y +c_{1}}{\mu \left (y \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (y \right )=\frac {1}{\cos \left (y \right )} \\ {} & {} & x=\cos \left (y \right ) \left (\int 1d y +c_{1} \right ) \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & x=\cos \left (y \right ) \left (y +c_{1} \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.0 (sec). Leaf size: 10

dsolve(diff(x(y),y)=cos(y)-x(y)*tan(y),x(y), singsol=all)
 

\[ x \left (y \right ) = \left (y +c_{1} \right ) \cos \left (y \right ) \]

Solution by Mathematica

Time used: 0.055 (sec). Leaf size: 12

DSolve[x'[y]==Cos[y]-x[y]*Tan[y],x[y],y,IncludeSingularSolutions -> True]
 

\[ x(y)\to (y+c_1) \cos (y) \]