2.38 problem 36

2.38.1 Solving as polynomial ode
2.38.2 Maple step by step solution

Internal problem ID [5786]
Internal file name [OUTPUT/5034_Sunday_June_05_2022_03_18_19_PM_14609277/index.tex]

Book: Ordinary differential equations and calculus of variations. Makarets and Reshetnyak. Wold Scientific. Singapore. 1995
Section: Chapter 1. First order differential equations. Section 1.2 Homogeneous equations problems. page 12
Problem number: 36.
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 C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

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

2.38.1 Solving as polynomial ode

This is ODE of type polynomial. Where the RHS of the ode is ratio of equations of two lines. Writing the ODE in the form \[ y^{\prime }= \frac {a_1 x + b_1 y + c_1}{ a_2 x + b_2 y + c_3 } \] Where \(a_1=1, b_1=-1, c_1 =-1, a_2=1, b_2=-1, c_2=-2\). There are now two possible solution methods. The first case is when the two lines \(a_1 x + b_1 y + c_1\),\( a_2 x + b_2 y + c_3\) are not parallel and the second case is if they are parallel. If they are not parallel, then the transformation \(X=x-x_0\), \(Y=y-y_0\) converts the ODE to a homogeneous ODE. The values \( x_0,y_0\) have to be determined. If they are parallel then a transformation \(U(x)=a_1 x + b_1 y\) converts the given ODE in \(y\) to a separable ODE in \(U(x)\). The first case is when \(\frac {a_1}{b_1} \neq \frac {a_2}{b_2}\) and the second case when \(\frac {a_1}{b_1} = \frac {a_2}{b_2}\). From the above we see that \(\frac {a_1}{b_1}=\frac {1}{-1}=-1\) and \(\frac {a_2}{b_2}=\frac {1}{-1}=-1\). Hence this is case two, where the lines are parallel. Let \(U(x)=x -y\). Solving for \(y\) gives \[ y=x -U \left (x \right ) \] Taking derivative w.r.t \(x\) gives \[ y^{\prime }=1-U^{\prime }\left (x \right ) \] Substituting the above into the ODE results in the ODE \[ -x +U \left (x \right )+\left (-U \left (x \right )+2\right ) \left (1-U^{\prime }\left (x \right )\right ) = 1-x \] Or \[ \left (U \left (x \right )-2\right ) U^{\prime }\left (x \right )+2-x = 1-x \] Or \[ U^{\prime }\left (x \right )=-\frac {1}{U \left (x \right )-2} \] Which is now solved as separable in \(U \left (x \right )\). In canonical form the ODE is \begin {align*} U' &= F(x,U)\\ &= f( x) g(U)\\ &= -\frac {1}{U -2} \end {align*}

Where \(f(x)=1\) and \(g(U)=-\frac {1}{U -2}\). Integrating both sides gives \begin{align*} \frac {1}{-\frac {1}{U -2}} \,dU &= 1 \,d x \\ \int { \frac {1}{-\frac {1}{U -2}} \,dU} &= \int {1 \,d x} \\ -\frac {U \left (U -4\right )}{2}&=x +c_{2} \\ \end{align*} The solution is \[ -\frac {U \left (x \right ) \left (U \left (x \right )-4\right )}{2}-x -c_{2} = 0 \] The solution \(-\frac {U \left (x \right ) \left (U \left (x \right )-4\right )}{2}-x -c_{2} = 0\) is converted to \(y\) using \(U \left (x \right ) = x -y\). Which gives \[ -\frac {\left (x -y\right ) \left (x -y-4\right )}{2}-x -c_{2} = 0 \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} -\frac {\left (x -y\right ) \left (x -y-4\right )}{2}-x -c_{2} &= 0 \\ \end{align*}

Figure 73: Slope field plot

Verification of solutions

\[ -\frac {\left (x -y\right ) \left (x -y-4\right )}{2}-x -c_{2} = 0 \] Verified OK.

2.38.2 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & -y+\left (y-x +2\right ) y^{\prime }=1-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 (x -y -1\right )d x +\textit {\_F1} \left (y \right ) \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & F \left (x , y\right )=\frac {x^{2}}{2}-y x -x +\textit {\_F1} \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} \\ {} & {} & y -x +2=-x +\frac {d}{d y}\textit {\_F1} \left (y \right ) \\ \bullet & {} & \textrm {Isolate for}\hspace {3pt} \frac {d}{d y}\textit {\_F1} \left (y \right ) \\ {} & {} & \frac {d}{d y}\textit {\_F1} \left (y \right )=y +2 \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_F1} \left (y \right ) \\ {} & {} & \textit {\_F1} \left (y \right )=\frac {1}{2} y^{2}+2 y \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_F1} \left (y \right )\hspace {3pt}\textrm {into equation for}\hspace {3pt} F \left (x , y\right ) \\ {} & {} & F \left (x , y\right )=\frac {1}{2} x^{2}-y x -x +\frac {1}{2} y^{2}+2 y \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} F \left (x , y\right )\hspace {3pt}\textrm {into the solution of the ODE}\hspace {3pt} \\ {} & {} & \frac {1}{2} x^{2}-y x -x +\frac {1}{2} y^{2}+2 y =c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & \left \{y=x -2-\sqrt {2 c_{1} -2 x +4}, y=x -2+\sqrt {2 c_{1} -2 x +4}\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 C 
1st order, trying the canonical coordinates of the invariance group 
<- 1st order, canonical coordinates successful 
<- homogeneous successful`
 

Solution by Maple

Time used: 0.015 (sec). Leaf size: 35

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

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

Solution by Mathematica

Time used: 0.102 (sec). Leaf size: 49

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

\begin{align*} y(x)\to x-i \sqrt {2 x-4-c_1}-2 \\ y(x)\to x+i \sqrt {2 x-4-c_1}-2 \\ \end{align*}