2.6 problem 6

2.6.1 Solving as homogeneous ode
2.6.2 Maple step by step solution

Internal problem ID [5092]
Internal file name [OUTPUT/4585_Sunday_June_05_2022_03_01_21_PM_13981050/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: 6.
ODE order: 1.
ODE degree: 1.

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

Maple gives the following as the ode type

[[_homogeneous, `class A`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

\[ \boxed {\left (2 y-x \right ) y^{\prime }-y=2 x} \]

2.6.1 Solving as homogeneous ode

In canonical form, the ODE is \begin {align*} y' &= F(x,y)\\ &= \frac {2 x +y}{2 y -x}\tag {1} \end {align*}

An ode of the form \(y' = \frac {M(x,y)}{N(x,y)}\) is called homogeneous if the functions \(M(x,y)\) and \(N(x,y)\) are both homogeneous functions and of the same order. Recall that a function \(f(x,y)\) is homogeneous of order \(n\) if \[ f(t^n x, t^n y)= t^n f(x,y) \] In this case, it can be seen that both \(M=-2 x -y\) and \(N=-2 y +x\) are both homogeneous and of the same order \(n=1\). Therefore this is a homogeneous ode. Since this ode is homogeneous, it is converted to separable ODE using the substitution \(u=\frac {y}{x}\), or \(y=ux\). Hence \[ \frac { \mathop {\mathrm {d}y}}{\mathop {\mathrm {d}x}}= \frac { \mathop {\mathrm {d}u}}{\mathop {\mathrm {d}x}}x + u \] Applying the transformation \(y=ux\) to the above ODE in (1) gives \begin {align*} \frac { \mathop {\mathrm {d}u}}{\mathop {\mathrm {d}x}}x + u &= \frac {u +2}{2 u -1}\\ \frac { \mathop {\mathrm {d}u}}{\mathop {\mathrm {d}x}} &= \frac {\frac {u \left (x \right )+2}{2 u \left (x \right )-1}-u \left (x \right )}{x} \end {align*}

Or \[ u^{\prime }\left (x \right )-\frac {\frac {u \left (x \right )+2}{2 u \left (x \right )-1}-u \left (x \right )}{x} = 0 \] Or \[ 2 u^{\prime }\left (x \right ) x u \left (x \right )-u^{\prime }\left (x \right ) x +2 u \left (x \right )^{2}-2 u \left (x \right )-2 = 0 \] Or \[ -2+x \left (2 u \left (x \right )-1\right ) u^{\prime }\left (x \right )+2 u \left (x \right )^{2}-2 u \left (x \right ) = 0 \] Which is now solved as separable in \(u \left (x \right )\). Which is now solved in \(u \left (x \right )\). In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= -\frac {2 \left (u^{2}-u -1\right )}{x \left (2 u -1\right )} \end {align*}

Where \(f(x)=-\frac {2}{x}\) and \(g(u)=\frac {u^{2}-u -1}{2 u -1}\). Integrating both sides gives \begin{align*} \frac {1}{\frac {u^{2}-u -1}{2 u -1}} \,du &= -\frac {2}{x} \,d x \\ \int { \frac {1}{\frac {u^{2}-u -1}{2 u -1}} \,du} &= \int {-\frac {2}{x} \,d x} \\ \ln \left (u^{2}-u -1\right )&=-2 \ln \left (x \right )+c_{2} \\ \end{align*} Raising both side to exponential gives \begin {align*} u^{2}-u -1 &= {\mathrm e}^{-2 \ln \left (x \right )+c_{2}} \end {align*}

Which simplifies to \begin {align*} u^{2}-u -1 &= \frac {c_{3}}{x^{2}} \end {align*}

Which simplifies to \[ u \left (x \right )^{2}-u \left (x \right )-1 = \frac {c_{3} {\mathrm e}^{c_{2}}}{x^{2}} \] The solution is \[ u \left (x \right )^{2}-u \left (x \right )-1 = \frac {c_{3} {\mathrm e}^{c_{2}}}{x^{2}} \] Now \(u\) in the above solution is replaced back by \(y\) using \(u=\frac {y}{x}\) which results in the solution \[ \frac {y^{2}}{x^{2}}-\frac {y}{x}-1 = \frac {c_{3} {\mathrm e}^{c_{2}}}{x^{2}} \] Which simplifies to \begin {align*} y^{2}-y x -x^{2} = c_{3} {\mathrm e}^{c_{2}} \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y^{2}-y x -x^{2} &= c_{3} {\mathrm e}^{c_{2}} \\ \end{align*}

Figure 39: Slope field plot

Verification of solutions

\[ y^{2}-y x -x^{2} = c_{3} {\mathrm e}^{c_{2}} \] Verified OK.

2.6.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (2 y-x \right ) y^{\prime }-y=2 x \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \square & {} & \textrm {Check if ODE is exact}\hspace {3pt} \\ {} & \circ & \textrm {ODE is exact if the lhs is the total derivative of a}\hspace {3pt} C^{2}\hspace {3pt}\textrm {function}\hspace {3pt} \\ {} & {} & F^{\prime }\left (x , y\right )=0 \\ {} & \circ & \textrm {Compute derivative of lhs}\hspace {3pt} \\ {} & {} & F^{\prime }\left (x , y\right )+\left (\frac {\partial }{\partial y}F \left (x , y\right )\right ) y^{\prime }=0 \\ {} & \circ & \textrm {Evaluate derivatives}\hspace {3pt} \\ {} & {} & -1=-1 \\ {} & \circ & \textrm {Condition met, ODE is exact}\hspace {3pt} \\ \bullet & {} & \textrm {Exact ODE implies solution will be of this form}\hspace {3pt} \\ {} & {} & \left [F \left (x , y\right )=c_{1} , M \left (x , y\right )=F^{\prime }\left (x , y\right ), N \left (x , y\right )=\frac {\partial }{\partial y}F \left (x , y\right )\right ] \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {by integrating}\hspace {3pt} M \left (x , y\right )\hspace {3pt}\textrm {with respect to}\hspace {3pt} x \\ {} & {} & F \left (x , y\right )=\int \left (-2 x -y \right )d x +f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & F \left (x , y\right )=-x^{2}-y x +f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Take derivative of}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {with respect to}\hspace {3pt} y \\ {} & {} & N \left (x , y\right )=\frac {\partial }{\partial y}F \left (x , y\right ) \\ \bullet & {} & \textrm {Compute derivative}\hspace {3pt} \\ {} & {} & 2 y -x =-x +\frac {d}{d y}f_{1} \left (y \right ) \\ \bullet & {} & \textrm {Isolate for}\hspace {3pt} \frac {d}{d y}f_{1} \left (y \right ) \\ {} & {} & \frac {d}{d y}f_{1} \left (y \right )=2 y \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} f_{1} \left (y \right ) \\ {} & {} & f_{1} \left (y \right )=y^{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} f_{1} \left (y \right )\hspace {3pt}\textrm {into equation for}\hspace {3pt} F \left (x , y\right ) \\ {} & {} & F \left (x , y\right )=-x^{2}-y x +y^{2} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {into the solution of the ODE}\hspace {3pt} \\ {} & {} & -x^{2}-y x +y^{2}=c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & \left \{y=\frac {x}{2}-\frac {\sqrt {5 x^{2}+4 c_{1}}}{2}, y=\frac {x}{2}+\frac {\sqrt {5 x^{2}+4 c_{1}}}{2}\right \} \end {array} \]

Maple trace

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

Solution by Maple

Time used: 0.047 (sec). Leaf size: 51

dsolve((2*y(x)-x)*diff(y(x),x)=2*x+y(x),y(x), singsol=all)
 

\begin{align*} y \left (x \right ) &= \frac {c_{1} x -\sqrt {5 c_{1}^{2} x^{2}+4}}{2 c_{1}} \\ y \left (x \right ) &= \frac {c_{1} x +\sqrt {5 c_{1}^{2} x^{2}+4}}{2 c_{1}} \\ \end{align*}

Solution by Mathematica

Time used: 0.454 (sec). Leaf size: 102

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

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