2.5.1 Problem 2

2.5.1.1 Solved using first_order_ode_dAlembert
2.5.1.2 Solved using first_order_ode_parametric method
2.5.1.3 Maple
2.5.1.4 Mathematica
2.5.1.5 Sympy

Internal problem ID [19730]
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 : Thursday, December 11, 2025 at 01:50:53 PM
CAS classification : [_rational, _dAlembert]

2.5.1.1 Solved using first_order_ode_dAlembert

0.154 (sec)

Entering first order ode dAlembert solver

\begin{align*} x {y^{\prime }}^{2}-y+2 y^{\prime }&=0 \\ \end{align*}
Let \(p=y^{\prime }\) the ode becomes
\begin{align*} x \,p^{2}+2 p -y = 0 \end{align*}

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

\begin{align*} \tag{1} y &= x \,p^{2}+2 p \\ \end{align*}
This has the form
\begin{align*} y=x f(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 x p +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 x \left (p \right ) p +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 {2}{p -1}d p}\\ \mu &= \left (p -1\right )^{2}\\ \mu &= \left (p -1\right )^{2}\tag {5} \end{align*}

Integrating gives

\begin{align*} x \left (p \right )&= \frac {1}{\mu } \left ( \int { \mu \left (-\frac {2}{p \left (p -1\right )}\right ) \,dp} + c_1\right )\\ &= \frac {1}{\mu } \left (\frac {-2 p +2 \ln \left (p \right )+c_1}{\left (p -1\right )^{2}}+c_1\right ) \\ &= \frac {-2 p +2 \ln \left (p \right )+c_1}{\left (p -1\right )^{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).

Eliminating \(p\) from the following two equations

\begin{align*} x &= \frac {-2 p +2 \ln \left (p \right )+c_1}{\left (p -1\right )^{2}} \\ y &= x \,p^{2}+2 p \\ \end{align*}
results in
\begin{align*} p &= {\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )} \\ \end{align*}
Substituting the above into Eq (1A) and simplifying gives
\begin{align*} y &= x \,{\mathrm e}^{2 \operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )}+2 \,{\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )} \\ \end{align*}
Simplifying the above gives
\begin{align*} y &= 0 \\ y &= x +2 \\ y &= 2 x \,{\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )}+2 \operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )+c_1 -x \\ \end{align*}

Summary of solutions found

\begin{align*} y &= 0 \\ y &= x +2 \\ y &= 2 x \,{\mathrm e}^{\operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )}+2 \operatorname {RootOf}\left (-{\mathrm e}^{2 \textit {\_Z}} x +2 \,{\mathrm e}^{\textit {\_Z}} x -2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )+c_1 -x \\ \end{align*}
2.5.1.2 Solved using first_order_ode_parametric method

0.607 (sec)

Entering first order ode parametric solver

\begin{align*} x {y^{\prime }}^{2}-y+2 y^{\prime }&=0 \\ \end{align*}
Let \(y^{\prime }\) be a parameter \(\lambda \). The ode becomes
\begin{align*} x \,\lambda ^{2}+2 \lambda -y = 0 \end{align*}

Isolating \(y\) gives

\begin{align*} y&=x \,\lambda ^{2}+2 \lambda \\ &=x \,\lambda ^{2}+2 \lambda \\ &=F \left (x , \lambda \right ) \end{align*}

Now we generate an ode in \(x \left (\lambda \right )\) using

\begin{align*} \frac {d}{d \lambda }x \left (\lambda \right ) &= \frac { \frac {\partial F}{\partial \lambda }} { \lambda -\frac {\partial F}{\partial x} } \\ &= \frac {2 \lambda x +2}{-\lambda ^{2}+\lambda }\\ &= \frac {-2-2 \lambda x \left (\lambda \right )}{\lambda \left (\lambda -1\right )} \end{align*}

Which is now solved for \(x\).

Entering first order ode linear solverIn canonical form a linear first order is

\begin{align*} \frac {d}{d \lambda }x \left (\lambda \right ) + q(\lambda )x \left (\lambda \right ) &= p(\lambda ) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(\lambda ) &=\frac {2}{\lambda -1}\\ p(\lambda ) &=-\frac {2}{\lambda \left (\lambda -1\right )} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,d\lambda }}\\ &= {\mathrm e}^{\int \frac {2}{\lambda -1}d \lambda }\\ &= \left (\lambda -1\right )^{2} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\lambda }}\left ( \mu x\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\lambda }}\left ( \mu x\right ) &= \left (\mu \right ) \left (-\frac {2}{\lambda \left (\lambda -1\right )}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\lambda }} \left (x \left (\lambda -1\right )^{2}\right ) &= \left (\left (\lambda -1\right )^{2}\right ) \left (-\frac {2}{\lambda \left (\lambda -1\right )}\right ) \\ \mathrm {d} \left (x \left (\lambda -1\right )^{2}\right ) &= \left (-\frac {2 \left (\lambda -1\right )}{\lambda }\right )\, \mathrm {d} \lambda \\ \end{align*}
Integrating gives
\begin{align*} x \left (\lambda -1\right )^{2}&= \int {-\frac {2 \left (\lambda -1\right )}{\lambda } \,d\lambda } \\ &=-2 \lambda +2 \ln \left (\lambda \right ) + c_1 \end{align*}

Dividing throughout by the integrating factor \(\left (\lambda -1\right )^{2}\) gives the final solution

\[ x \left (\lambda \right ) = \frac {-2 \lambda +2 \ln \left (\lambda \right )+c_1}{\left (\lambda -1\right )^{2}} \]
Now that we found solution \(x\) we have two equations with parameter \(\lambda \). They are
\begin{align*} y &= x \,\lambda ^{2}+2 \lambda \\ x &= \frac {-2 \lambda +2 \ln \left (\lambda \right )+c_1}{\left (\lambda -1\right )^{2}} \\ \end{align*}
Eliminating \(\lambda \) gives the solution for \(y\).
\[ -y+2 \operatorname {RootOf}\left (\textit {\_Z}^{2} x +2 \textit {\_Z} -y\right ) x +2 \ln \left (\operatorname {RootOf}\left (\textit {\_Z}^{2} x +2 \textit {\_Z} -y\right )\right )+c_1 -x \]
Which can be written as
\begin{align*} {\mathrm e}^{-2 \operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )+y-c_1 +x} x +2 \,{\mathrm e}^{-\operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )+\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}-y &= 0 \\ \end{align*}
Simplifying the above gives
\begin{align*} \frac {\operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )^{2}}{x}+\frac {2 \operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )}{x}-y &= 0 \\ \end{align*}

Summary of solutions found

\begin{align*} \frac {\operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )^{2}}{x}+\frac {2 \operatorname {LambertW}\left (x \,{\mathrm e}^{\frac {y}{2}-\frac {c_1}{2}+\frac {x}{2}}\right )}{x}-y &= 0 \\ \end{align*}
2.5.1.3 Maple. Time used: 0.020 (sec). Leaf size: 65
ode:=x*diff(y(x),x)^2+2*diff(y(x),x)-y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = 2 x \,{\mathrm e}^{\operatorname {RootOf}\left (-x \,{\mathrm e}^{2 \textit {\_Z}}+2 x \,{\mathrm e}^{\textit {\_Z}}-2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )}+2 \operatorname {RootOf}\left (-x \,{\mathrm e}^{2 \textit {\_Z}}+2 x \,{\mathrm e}^{\textit {\_Z}}-2 \,{\mathrm e}^{\textit {\_Z}}+c_1 +2 \textit {\_Z} -x \right )+c_1 -x \]

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 step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x \left (\frac {d}{d x}y \left (x \right )\right )^{2}-y \left (x \right )+2 \frac {d}{d x}y \left (x \right )=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d x}y \left (x \right )=\frac {-1+\sqrt {x y \left (x \right )+1}}{x}, \frac {d}{d x}y \left (x \right )=-\frac {1+\sqrt {x y \left (x \right )+1}}{x}\right ] \\ \bullet & {} & \textrm {Solve the equation}\hspace {3pt} \frac {d}{d x}y \left (x \right )=\frac {-1+\sqrt {x y \left (x \right )+1}}{x} \\ \bullet & {} & \textrm {Solve the equation}\hspace {3pt} \frac {d}{d x}y \left (x \right )=-\frac {1+\sqrt {x y \left (x \right )+1}}{x} \\ \bullet & {} & \textrm {Set of solutions}\hspace {3pt} \\ {} & {} & \left \{\mathit {workingODE} , \mathit {workingODE}\right \} \end {array} \]
2.5.1.4 Mathematica. Time used: 9.61 (sec). Leaf size: 50
ode=x*D[y[x],x]^2-y[x]+2*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},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 ] \]
2.5.1.5 Sympy
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