1.1 problem 1

1.1.1 Solving as separable ode
1.1.2 Maple step by step solution

Internal problem ID [3146]
Internal file name [OUTPUT/2638_Sunday_June_05_2022_08_37_51_AM_88841125/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: 1.
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 {\cos \left (y\right )^{2}+\left (1+{\mathrm e}^{-x}\right ) \sin \left (y\right ) y^{\prime }=0} \]

1.1.1 Solving as separable ode

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

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

Summary

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

Figure 1: Slope field plot

Verification of solutions

\[ y = \pi -\arccos \left (\frac {1}{\ln \left (\left ({\mathrm e}^{x}+1\right ) {\mathrm e}^{-x}\right )+x -c_{1}}\right ) \] Verified OK.

1.1.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \cos \left (y\right )^{2}+\left (1+{\mathrm e}^{-x}\right ) \sin \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 {\cos \left (y\right )^{2}}{\left (1+{\mathrm e}^{-x}\right ) \sin \left (y\right )} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {y^{\prime } \sin \left (y\right )}{\cos \left (y\right )^{2}}=-\frac {1}{1+{\mathrm e}^{-x}} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int \frac {y^{\prime } \sin \left (y\right )}{\cos \left (y\right )^{2}}d x =\int -\frac {1}{1+{\mathrm e}^{-x}}d x +c_{1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {1}{\cos \left (y\right )}=-\ln \left (1+{\mathrm e}^{-x}\right )+\ln \left ({\mathrm e}^{-x}\right )+c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & y=\pi -\arccos \left (\frac {1}{\ln \left (\frac {{\mathrm e}^{x}+1}{{\mathrm e}^{x}}\right )+x -c_{1}}\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.015 (sec). Leaf size: 18

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

\[ y \left (x \right ) = \frac {\pi }{2}+\arcsin \left (\frac {1}{\ln \left (1+{\mathrm e}^{x}\right )+c_{1}}\right ) \]

Solution by Mathematica

Time used: 0.95 (sec). Leaf size: 57

DSolve[Cos[y[x]]^2+(1+Exp[-x])*Sin[y[x]]*y'[x]==0,y[x],x,IncludeSingularSolutions -> True]
 

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