1.128 problem 129

1.128.1 Solved as first order Bernoulli ode
1.128.2 Solved as first order ode of type Riccati
1.128.3 Maple step by step solution
1.128.4 Maple trace
1.128.5 Maple dsolve solution
1.128.6 Mathematica DSolve solution

Internal problem ID [9110]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 129
Date solved : Thursday, October 17, 2024 at 01:20:06 PM
CAS classification : [_rational, _Bernoulli]

Solve

\begin{align*} \left (x +1\right ) y^{\prime }+y \left (y-x \right )&=0 \end{align*}

1.128.1 Solved as first order Bernoulli ode

Time used: 0.158 (sec)

In canonical form, the ODE is

\begin{align*} y' &= F(x,y)\\ &= -\frac {y \left (y -x \right )}{x +1} \end{align*}

This is a Bernoulli ODE.

\[ y' = \left (\frac {x}{x +1}\right ) + \left (-\frac {1}{x +1}\right )y^{2} \tag {1} \]

The standard Bernoulli ODE has the form

\[ y' = f_0(x)y+f_1(x)y^n \tag {2} \]

Comparing this to (1) shows that

\begin{align*} f_0 &=\frac {x}{x +1}\\ f_1 &=-\frac {1}{x +1} \end{align*}

The first step is to divide the above equation by \(y^n \) which gives

\[ \frac {y'}{y^n} = f_0(x) y^{1-n} +f_1(x) \tag {3} \]

The next step is use the substitution \(v = y^{1-n}\) in equation (3) which generates a new ODE in \(v \left (x \right )\) which will be linear and can be easily solved using an integrating factor. Backsubstitution then gives the solution \(y(x)\) which is what we want.

This method is now applied to the ODE at hand. Comparing the ODE (1) With (2) Shows that

\begin{align*} f_0(x)&=\frac {x}{x +1}\\ f_1(x)&=-\frac {1}{x +1}\\ n &=2 \end{align*}

Dividing both sides of ODE (1) by \(y^n=y^{2}\) gives

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

Let

\begin{align*} v &= y^{1-n} \\ &= \frac {1}{y} \tag {5} \end{align*}

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

\begin{align*} v' &= -\frac {1}{y^{2}}y' \tag {6} \end{align*}

Substituting equations (5) and (6) into equation (4) gives

\begin{align*} -v^{\prime }\left (x \right )&= \frac {x v \left (x \right )}{x +1}-\frac {1}{x +1}\\ v' &= -\frac {x v}{x +1}+\frac {1}{x +1} \tag {7} \end{align*}

The above now is a linear ODE in \(v \left (x \right )\) which is now solved.

In canonical form a linear first order is

\begin{align*} v^{\prime }\left (x \right ) + q(x)v \left (x \right ) &= p(x) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(x) &=\frac {x}{x +1}\\ p(x) &=\frac {1}{x +1} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int \frac {x}{x +1}d x}\\ &= \frac {{\mathrm e}^{x}}{x +1} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu v\right ) &= \left (\mu \right ) \left (\frac {1}{x +1}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {v \,{\mathrm e}^{x}}{x +1}\right ) &= \left (\frac {{\mathrm e}^{x}}{x +1}\right ) \left (\frac {1}{x +1}\right ) \\ \mathrm {d} \left (\frac {v \,{\mathrm e}^{x}}{x +1}\right ) &= \left (\frac {{\mathrm e}^{x}}{\left (x +1\right )^{2}}\right )\, \mathrm {d} x \\ \end{align*}

Integrating gives

\begin{align*} \frac {v \,{\mathrm e}^{x}}{x +1}&= \int {\frac {{\mathrm e}^{x}}{\left (x +1\right )^{2}} \,dx} \\ &=-\frac {{\mathrm e}^{x}}{x +1}-{\mathrm e}^{-1} \operatorname {Ei}_{1}\left (-x -1\right ) + c_1 \end{align*}

Dividing throughout by the integrating factor \(\frac {{\mathrm e}^{x}}{x +1}\) gives the final solution

\[ v \left (x \right ) = -{\mathrm e}^{-x -1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-1+c_1 \left (x +1\right ) {\mathrm e}^{-x} \]

The substitution \(v = y^{1-n}\) is now used to convert the above solution back to \(y\) which results in

\[ \frac {1}{y} = -{\mathrm e}^{-x -1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-1+c_1 \left (x +1\right ) {\mathrm e}^{-x} \]

Solving for \(y\) from the above solution(s) gives (after possible removing of solutions that do not verify)

\begin{align*} y = -\frac {1}{x \,{\mathrm e}^{-x -1} \operatorname {Ei}_{1}\left (-x -1\right )+{\mathrm e}^{-x -1} \operatorname {Ei}_{1}\left (-x -1\right )-c_1 x \,{\mathrm e}^{-x}-c_1 \,{\mathrm e}^{-x}+1} \end{align*}
Figure 115: Slope field plot
\(\left (x +1\right ) y^{\prime }+y \left (y-x \right ) = 0\)
1.128.2 Solved as first order ode of type Riccati

Time used: 0.218 (sec)

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= -\frac {y \left (y -x \right )}{x +1} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = -\frac {y^{2}}{x +1}+\frac {y x}{x +1} \]

With Riccati ODE standard form

\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]

Shows that \(f_0(x)=0\), \(f_1(x)=\frac {x}{x +1}\) and \(f_2(x)=-\frac {1}{x +1}\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{-\frac {u}{x +1}} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification)in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=\frac {1}{\left (x +1\right )^{2}}\\ f_1 f_2 &=-\frac {x}{\left (x +1\right )^{2}}\\ f_2^2 f_0 &=0 \end{align*}

Substituting the above terms back in equation (2) gives

\begin{align*} -\frac {u^{\prime \prime }\left (x \right )}{x +1}-\left (\frac {1}{\left (x +1\right )^{2}}-\frac {x}{\left (x +1\right )^{2}}\right ) u^{\prime }\left (x \right ) = 0 \end{align*}

This is second order ode with missing dependent variable \(u\). Let

\begin{align*} p(x) &= \frac {d u}{d x} \end{align*}

Then

\begin{align*} p'(x) &= \frac {d^{2}u}{d x^{2}} \end{align*}

Hence the ode becomes

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

Which is now solve for \(p(x)\) as first order ode. In canonical form a linear first order is

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

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\frac {-1+x}{x +1}\\ p(x) &=0 \end{align*}

The integrating factor \(\mu \) is

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

The ode becomes

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

Integrating gives

\begin{align*} p \left (x +1\right )^{2} {\mathrm e}^{-x}&= \int {0 \,dx} + c_1 \\ &=c_1 \end{align*}

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

\[ p \left (x \right ) = \frac {{\mathrm e}^{x} c_1}{\left (x +1\right )^{2}} \]

For solution (1) found earlier, since \(p=\frac {d u}{d x}\) then we now have a new first order ode to solve which is

\begin{align*} \frac {d u}{d x} = \frac {{\mathrm e}^{x} c_1}{\left (x +1\right )^{2}} \end{align*}

Since the ode has the form \(\frac {d u}{d x}=f(x)\), then we only need to integrate \(f(x)\).

\begin{align*} \int {du} &= \int {\frac {{\mathrm e}^{x} c_1}{\left (x +1\right )^{2}}\, dx}\\ u &= c_1 \left (-\frac {{\mathrm e}^{x}}{x +1}-{\mathrm e}^{-1} \operatorname {Ei}_{1}\left (-x -1\right )\right ) + c_2 \end{align*}

Will add steps showing solving for IC soon.

Taking derivative gives

\[ u^{\prime }\left (x \right ) = \frac {-{\mathrm e}^{-1} \operatorname {Ei}_{1}\left (-x -1\right ) c_1 -\frac {c_1 \,{\mathrm e}^{-1} \left (x +1\right ) {\mathrm e}^{x +1}}{-x -1}-{\mathrm e}^{x} c_1 +c_2}{x +1}-\frac {-c_1 \,{\mathrm e}^{-1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-{\mathrm e}^{x} c_1 +c_2 \left (x +1\right )}{\left (x +1\right )^{2}} \]

Doing change of constants, the solution becomes

\[ y = \frac {\left (\frac {-{\mathrm e}^{-1} \operatorname {Ei}_{1}\left (-x -1\right ) c_3 -\frac {c_3 \,{\mathrm e}^{-1} \left (x +1\right ) {\mathrm e}^{x +1}}{-x -1}-{\mathrm e}^{x} c_3 +1}{x +1}-\frac {-c_3 \,{\mathrm e}^{-1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-{\mathrm e}^{x} c_3 +x +1}{\left (x +1\right )^{2}}\right ) \left (x +1\right )^{2}}{-c_3 \,{\mathrm e}^{-1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-{\mathrm e}^{x} c_3 +x +1} \]
Figure 116: Slope field plot
\(\left (x +1\right ) y^{\prime }+y \left (y-x \right ) = 0\)
1.128.3 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left (x +1\right ) \left (\frac {d}{d x}y \left (x \right )\right )+y \left (x \right ) \left (y \left (x \right )-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} \\ {} & {} & \frac {d}{d x}y \left (x \right )=-\frac {y \left (x \right ) \left (y \left (x \right )-x \right )}{x +1} \end {array} \]

1.128.4 Maple trace
`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
<- Bernoulli successful`
 
1.128.5 Maple dsolve solution

Solving time : 0.005 (sec)
Leaf size : 33

dsolve((x+1)*diff(y(x),x)+y(x)*(y(x)-x) = 0, 
       y(x),singsol=all)
 
\[ y = \frac {{\mathrm e}^{x}}{-{\mathrm e}^{-1} \left (x +1\right ) \operatorname {Ei}_{1}\left (-x -1\right )-{\mathrm e}^{x}+c_{1} \left (x +1\right )} \]
1.128.6 Mathematica DSolve solution

Solving time : 0.378 (sec)
Leaf size : 42

DSolve[{(x+1)*D[y[x],x]+ y[x]*(y[x]-x)==0,{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {e^{x+1}}{-(x+1) \operatorname {ExpIntegralEi}(x+1)+e \left (e^x-c_1 (x+1)\right )} \\ y(x)\to 0 \\ \end{align*}