2.5.1 Problem 2

Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution
Sympy solution

Internal problem ID [18550]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 32. Problems at page 89
Problem number : 2
Date solved : Saturday, February 22, 2025 at 09:25:19 PM
CAS classification : [_rational, _dAlembert]

Solve

\begin{align*} x {y^{\prime }}^{2}-y+2 y^{\prime }&=0 \end{align*}

Solving for the derivative gives these ODE’s to solve

\begin{align*} \tag{1} y^{\prime }&=\frac {-1+\sqrt {y x +1}}{x} \\ \tag{2} y^{\prime }&=-\frac {1+\sqrt {y x +1}}{x} \\ \end{align*}

Now each of the above is solved separately.

Solving Eq. (1)

Let \(p=y^{\prime }\) the ode becomes

\begin{align*} p = \frac {-1+\sqrt {y x +1}}{x} \end{align*}

Solving for \(y\) from the above results in

\begin{align*} \tag{1} y &= p^{2} x +2 p \\ \end{align*}

This has the form

\begin{align*} y=xf(p)+g(p)\tag {*} \end{align*}

Where \(f,g\) are functions of \(p=y'(x)\). The above ode is dAlembert ode which is now solved.

Taking derivative of (*) w.r.t. \(x\) gives

\begin{align*} p &= f+(x f'+g') \frac {dp}{dx}\\ p-f &= (x f'+g') \frac {dp}{dx}\tag {2} \end{align*}

Comparing the form \(y=x f + g\) to (1A) shows that

\begin{align*} f &= p^{2}\\ g &= 2 p \end{align*}

Hence (2) becomes

\begin{equation} \tag{2A} -p^{2}+p = \left (2 p x +2\right ) p^{\prime }\left (x \right ) \end{equation}

The singular solution is found by setting \(\frac {dp}{dx}=0\) in the above which gives

\begin{align*} -p^{2}+p = 0 \end{align*}

Solving the above for \(p\) results in

\begin{align*} p_{1} &=0\\ p_{2} &=1 \end{align*}

Substituting these in (1A) and keeping singular solution that verifies the ode gives

\begin{align*} y = 0\\ y = x +2 \end{align*}

The general solution is found when \( \frac { \mathop {\mathrm {d}p}}{\mathop {\mathrm {d}x}}\neq 0\). From eq. (2A). This results in

\begin{equation} \tag{3} p^{\prime }\left (x \right ) = \frac {-p \left (x \right )^{2}+p \left (x \right )}{2 p \left (x \right ) x +2} \end{equation}

Inverting the above ode gives

\begin{align*} \frac {d}{d p}x \left (p \right ) = \frac {2 p x \left (p \right )+2}{-p^{2}+p}\tag {4} \end{align*}

This ODE is now solved for \(x \left (p \right )\). The integrating factor is

\begin{align*} \mu &= {\mathrm e}^{\int -\frac {-p +1}{2 p x +2}d x}\\ \mu &= {\mathrm e}^{\frac {\left (\frac {p}{2}-\frac {1}{2}\right ) \ln \left (p x +1\right )}{p}}\\ \mu &= \left (p x +1\right )^{\frac {p -1}{2 p}}\tag {5} \end{align*}

Integrating gives

\begin{align*} p \left (x \right )&= \frac {1}{\mu } c_2\\ &= \left (p x +1\right )^{-\frac {p -1}{2 p}} c_2\tag {5} \end{align*}

Now we need to eliminate \(p\) between the above solution and (1A). The first method is to solve for \(p\) from Eq. (1A) and substitute the result into Eq. (5). The Second method is to solve for \(p\) from Eq. (5) and substitute the result into (1A).

Unable to solve for \(p\) from Eq(5). Will use the first method. Solving for \(p\) from Eq. (1A) gives

\begin{align*} p&=\frac {-1+\sqrt {y x +1}}{x} \\ p&=-\frac {1+\sqrt {y x +1}}{x} \\ \end{align*}

Substituting the above in the solution for \(x\) in Eq. (5) gives

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

We now need to find the singular solutions, these are found by finding for what values \((\frac {-1+\sqrt {y x +1}}{x})\) is zero. These give

\begin{align*} y&=0 \\ \end{align*}

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

The solution \(y = 0\) satisfies the ode and initial conditions.

Solving Eq. (2)

Let \(p=y^{\prime }\) the ode becomes

\begin{align*} p = -\frac {1+\sqrt {y x +1}}{x} \end{align*}

Solving for \(y\) from the above results in

\begin{align*} \tag{1} y &= p^{2} x +2 p \\ \end{align*}

This has the form

\begin{align*} y=xf(p)+g(p)\tag {*} \end{align*}

Where \(f,g\) are functions of \(p=y'(x)\). The above ode is dAlembert ode which is now solved.

Taking derivative of (*) w.r.t. \(x\) gives

\begin{align*} p &= f+(x f'+g') \frac {dp}{dx}\\ p-f &= (x f'+g') \frac {dp}{dx}\tag {2} \end{align*}

Comparing the form \(y=x f + g\) to (1A) shows that

\begin{align*} f &= p^{2}\\ g &= 2 p \end{align*}

Hence (2) becomes

\begin{equation} \tag{2A} -p^{2}+p = \left (2 p x +2\right ) p^{\prime }\left (x \right ) \end{equation}

The singular solution is found by setting \(\frac {dp}{dx}=0\) in the above which gives

\begin{align*} -p^{2}+p = 0 \end{align*}

No valid singular solutions found.

The general solution is found when \( \frac { \mathop {\mathrm {d}p}}{\mathop {\mathrm {d}x}}\neq 0\). From eq. (2A). This results in

\begin{equation} \tag{3} p^{\prime }\left (x \right ) = \frac {-p \left (x \right )^{2}+p \left (x \right )}{2 p \left (x \right ) x +2} \end{equation}

Inverting the above ode gives

\begin{align*} \frac {d}{d p}x \left (p \right ) = \frac {2 p x \left (p \right )+2}{-p^{2}+p}\tag {4} \end{align*}

This ODE is now solved for \(x \left (p \right )\). The integrating factor is

\begin{align*} \mu &= {\mathrm e}^{\int -\frac {-p +1}{2 p x +2}d x}\\ \mu &= {\mathrm e}^{\frac {\left (\frac {p}{2}-\frac {1}{2}\right ) \ln \left (p x +1\right )}{p}}\\ \mu &= \left (p x +1\right )^{\frac {p -1}{2 p}}\tag {5} \end{align*}

Integrating gives

\begin{align*} p \left (x \right )&= \frac {1}{\mu } c_3\\ &= \left (p x +1\right )^{-\frac {p -1}{2 p}} c_3\tag {5} \end{align*}

Now we need to eliminate \(p\) between the above solution and (1A). The first method is to solve for \(p\) from Eq. (1A) and substitute the result into Eq. (5). The Second method is to solve for \(p\) from Eq. (5) and substitute the result into (1A).

Unable to solve for \(p\) from Eq(5). Will use the first method. Solving for \(p\) from Eq. (1A) gives

\begin{align*} p&=\frac {-1+\sqrt {y x +1}}{x} \\ p&=-\frac {1+\sqrt {y x +1}}{x} \\ \end{align*}

Substituting the above in the solution for \(x\) in Eq. (5) gives

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

Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x {y^{\prime }}^{2}-y+2 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} \\ {} & {} & \left [y^{\prime }=\frac {-1+\sqrt {x y+1}}{x}, y^{\prime }=-\frac {1+\sqrt {x y+1}}{x}\right ] \\ \bullet & {} & \textrm {Solve the equation}\hspace {3pt} y^{\prime }=\frac {-1+\sqrt {x y+1}}{x} \\ \bullet & {} & \textrm {Solve the equation}\hspace {3pt} y^{\prime }=-\frac {1+\sqrt {x y+1}}{x} \\ \bullet & {} & \textrm {Set of solutions}\hspace {3pt} \\ {} & {} & \left \{\mathit {workingODE} , \mathit {workingODE}\right \} \end {array} \]

Maple trace
`Methods for first order ODEs: 
-> Solving 1st order ODE of high degree, 1st attempt 
trying 1st order WeierstrassP solution for high degree ODE 
trying 1st order WeierstrassPPrime solution for high degree ODE 
trying 1st order JacobiSN solution for high degree ODE 
trying 1st order ODE linearizable_by_differentiation 
trying differential order: 1; missing variables 
trying dAlembert 
<- dAlembert successful`
 
Maple dsolve solution

Solving time : 0.017 (sec)
Leaf size : 65

dsolve(x*diff(y(x),x)^2-y(x)+2*diff(y(x),x) = 0,y(x),singsol=all)
 
\[ y \left (x \right ) = 2 x \,{\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 x \,{\mathrm e}^{\textit {\_Z}}-2 \,{\mathrm e}^{\textit {\_Z}}+c_{1} +2 \textit {\_Z} -x \right )}+2 \operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 x \,{\mathrm e}^{\textit {\_Z}}-2 \,{\mathrm e}^{\textit {\_Z}}+c_{1} +2 \textit {\_Z} -x \right )+c_{1} -x \]
Mathematica DSolve solution

Solving time : 12.594 (sec)
Leaf size : 50

DSolve[{x*D[y[x],x]^2-y[x]+2*D[y[x],x]==0,{}},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [\left \{x=\frac {2 \log (K[1])-2 K[1]}{(K[1]-1)^2}+\frac {c_1}{(K[1]-1)^2},y(x)=x K[1]^2+2 K[1]\right \},\{y(x),K[1]\}\right ] \]
Sympy solution

Solving time : 0.000 (sec)
Leaf size : 0

Python version: 3.13.1 (main, Dec  4 2024, 18:05:56) [GCC 14.2.1 20240910] 
Sympy version 1.13.3
 
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x)**2 - y(x) + 2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (sqrt(x*y(x) + 1) - 1)/x cannot be solved by the factorable group method