1.4 problem 4

1.4.1 Solving as separable ode
1.4.2 Maple step by step solution

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

1.4.1 Solving as separable ode

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

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

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \tan \left (\operatorname {RootOf}\left (-{\mathrm e}^{x} x +{\mathrm e}^{x}-\ln \left (\frac {1}{\cos \left (\textit {\_Z} \right )^{2}}\right )+c_{1} -\textit {\_Z} \right )\right ) \\ \end{align*}

Figure 4: Slope field plot

Verification of solutions

\[ y = \tan \left (\operatorname {RootOf}\left (-{\mathrm e}^{x} x +{\mathrm e}^{x}-\ln \left (\frac {1}{\cos \left (\textit {\_Z} \right )^{2}}\right )+c_{1} -\textit {\_Z} \right )\right ) \] Verified OK.

1.4.2 Maple step by step solution

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

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

\[ y \left (x \right ) = \tan \left (\operatorname {RootOf}\left (x \,{\mathrm e}^{x}-{\mathrm e}^{x}+\ln \left (2\right )+\ln \left (\frac {1}{1+\cos \left (2 \textit {\_Z} \right )}\right )+\textit {\_Z} +c_{1} \right )\right ) \]

Solution by Mathematica

Time used: 0.627 (sec). Leaf size: 43

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

\begin{align*} y(x)\to \text {InverseFunction}\left [\log \left (\text {$\#$1}^2+1\right )+\arctan (\text {$\#$1})\&\right ]\left [-e^x (x-1)+c_1\right ] \\ y(x)\to -i \\ y(x)\to i \\ \end{align*}