1.3 problem 3

1.3.1 Solving as separable ode
1.3.2 Maple step by step solution

Internal problem ID [3148]
Internal file name [OUTPUT/2640_Sunday_June_05_2022_08_37_53_AM_87021584/index.tex]

Book: Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section: Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number: 3.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[_separable]

\[ \boxed {x \cos \left (y\right )^{2}+{\mathrm e}^{x} \tan \left (y\right ) y^{\prime }=0} \]

1.3.1 Solving as separable ode

In canonical form the ODE is \begin {align*} y' &= F(x,y)\\ &= f( x) g(y)\\ &= -x \,{\mathrm e}^{-x} \cos \left (y \right )^{2} \cot \left (y \right ) \end {align*}

Where \(f(x)=-x \,{\mathrm e}^{-x}\) and \(g(y)=\cos \left (y \right )^{2} \cot \left (y \right )\). Integrating both sides gives \begin{align*} \frac {1}{\cos \left (y \right )^{2} \cot \left (y \right )} \,dy &= -x \,{\mathrm e}^{-x} \,d x \\ \int { \frac {1}{\cos \left (y \right )^{2} \cot \left (y \right )} \,dy} &= \int {-x \,{\mathrm e}^{-x} \,d x} \\ \frac {1}{2 \cot \left (y \right )^{2}}&=\left (x +1\right ) {\mathrm e}^{-x}+c_{1} \\ \end{align*} Which results in \begin{align*} y &= \operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \\ y &= \pi -\operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \\ \end{align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \\ \tag{2} y &= \pi -\operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \\ \end{align*}

Figure 3: Slope field plot

Verification of solutions

\[ y = \operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \] Verified OK.

\[ y = \pi -\operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{2 c_{1} {\mathrm e}^{x}+2 x +2}\right ) \] Verified OK.

1.3.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \cos \left (y\right )^{2}+{\mathrm e}^{x} \tan \left (y\right ) y^{\prime }=0 \\ \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 {x \cos \left (y\right )^{2}}{{\mathrm e}^{x} \tan \left (y\right )} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {y^{\prime } \tan \left (y\right )}{\cos \left (y\right )^{2}}=-\frac {x}{{\mathrm e}^{x}} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {y^{\prime } \tan \left (y\right )}{\cos \left (y\right )^{2}}d x =\int -\frac {x}{{\mathrm e}^{x}}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {\tan \left (y\right )^{2}}{2}=\frac {x +1}{{\mathrm e}^{x}}+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & \left \{y=-\arctan \left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{{\mathrm e}^{x}}\right ), y=\arctan \left (\frac {\sqrt {2}\, \sqrt {\left (c_{1} {\mathrm e}^{x}+x +1\right ) {\mathrm e}^{x}}}{{\mathrm e}^{x}}\right )\right \} \end {array} \]

Maple trace

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

Solution by Maple

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

dsolve(x*cos(y(x))^2+exp(x)*tan(y(x))*diff(y(x),x)=0,y(x), singsol=all)
 

\begin{align*} y \left (x \right ) &= \pi -\operatorname {arccot}\left (\frac {\sqrt {2}\, \sqrt {\left (-{\mathrm e}^{x} c_{1} +x +1\right ) {\mathrm e}^{x}}}{-2 \,{\mathrm e}^{x} c_{1} +2 x +2}\right ) \\ y \left (x \right ) &= \frac {\pi }{2}-\arctan \left (\frac {\sqrt {2}\, \sqrt {\left (-{\mathrm e}^{x} c_{1} +x +1\right ) {\mathrm e}^{x}}}{-2 \,{\mathrm e}^{x} c_{1} +2 x +2}\right ) \\ \end{align*}

Solution by Mathematica

Time used: 15.741 (sec). Leaf size: 149

DSolve[x*Cos[y[x]]^2+Exp[x]*Tan[y[x]]*y'[x]==0,y[x],x,IncludeSingularSolutions -> True]
 

\begin{align*} y(x)\to -\sec ^{-1}\left (-\sqrt {2} \sqrt {e^{-x} \left (x+4 c_1 e^x+1\right )}\right ) \\ y(x)\to \sec ^{-1}\left (-\sqrt {2} \sqrt {e^{-x} \left (x+4 c_1 e^x+1\right )}\right ) \\ y(x)\to -\sec ^{-1}\left (\sqrt {2} \sqrt {e^{-x} \left (x+4 c_1 e^x+1\right )}\right ) \\ y(x)\to \sec ^{-1}\left (\sqrt {2} \sqrt {e^{-x} \left (x+4 c_1 e^x+1\right )}\right ) \\ y(x)\to -\frac {\pi }{2} \\ y(x)\to \frac {\pi }{2} \\ \end{align*}