2.1.32 Problem 33

2.1.32.1 Existence and uniqueness analysis
2.1.32.2 Solved using first_order_ode_autonomous
2.1.32.3 Solved using first_order_ode_exact
2.1.32.4 Solved using first_order_ode_dAlembert
2.1.32.5 Maple
2.1.32.6 Mathematica
2.1.32.7 Sympy

Internal problem ID [10018]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 33
Date solved : Monday, December 08, 2025 at 07:04:23 PM
CAS classification : [_quadrature]

2.1.32.1 Existence and uniqueness analysis
\begin{align*} y^{\prime }&=\frac {1}{1-y} \\ y \left (0\right ) &= 2 \\ \end{align*}
This is non linear first order ODE. In canonical form it is written as
\begin{align*} y^{\prime } &= f(t,y)\\ &= -\frac {1}{-1+y} \end{align*}

The \(y\) domain of \(f(t,y)\) when \(t=0\) is

\[ \{y <1\boldsymbol {\lor }1<y\} \]
And the point \(y_0 = 2\) is inside this domain. Now we will look at the continuity of
\begin{align*} \frac {\partial f}{\partial y} &= \frac {\partial }{\partial y}\left (-\frac {1}{-1+y}\right ) \\ &= \frac {1}{\left (-1+y \right )^{2}} \end{align*}

The \(y\) domain of \(\frac {\partial f}{\partial y}\) when \(t=0\) is

\[ \{y <1\boldsymbol {\lor }1<y\} \]
And the point \(y_0 = 2\) is inside this domain. Therefore solution exists and is unique.
2.1.32.2 Solved using first_order_ode_autonomous

0.035 (sec)

Entering first order ode autonomous solver

\begin{align*} y^{\prime }&=\frac {1}{1-y} \\ y \left (0\right ) &= 2 \\ \end{align*}
Integrating gives
\begin{align*} \int \left (1-y \right )d y &= dt\\ y -\frac {1}{2} y^{2}&= t +c_1 \end{align*}

Solving for initial conditions the solution is

\begin{align*} y-\frac {y^{2}}{2} &= t \\ \end{align*}
Solving for \(y\) gives
\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
Solution plot Slope field \(y^{\prime } = \frac {1}{1-y}\)

Summary of solutions found

\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
2.1.32.3 Solved using first_order_ode_exact

0.079 (sec)

Entering first order ode exact solver

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

To solve an ode of the form

\begin{equation} M\left ( x,y\right ) +N\left ( x,y\right ) \frac {dy}{dx}=0\tag {A}\end{equation}
We assume there exists a function \(\phi \left ( x,y\right ) =c\) where \(c\) is constant, that satisfies the ode. Taking derivative of \(\phi \) w.r.t. \(x\) gives
\[ \frac {d}{dx}\phi \left ( x,y\right ) =0 \]
Hence
\begin{equation} \frac {\partial \phi }{\partial x}+\frac {\partial \phi }{\partial y}\frac {dy}{dx}=0\tag {B}\end{equation}
Comparing (A,B) shows that
\begin{align*} \frac {\partial \phi }{\partial x} & =M\\ \frac {\partial \phi }{\partial y} & =N \end{align*}

But since \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) then for the above to be valid, we require that

\[ \frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\]
If the above condition is satisfied, then the original ode is called exact. We still need to determine \(\phi \left ( x,y\right ) \) but at least we know now that we can do that since the condition \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) is satisfied. If this condition is not satisfied then this method will not work and we have to now look for an integrating factor to force this condition, which might or might not exist. The first step is to write the ODE in standard form to check for exactness, which is
\[ M(t,y) \mathop {\mathrm {d}t}+ N(t,y) \mathop {\mathrm {d}y}=0 \tag {1A} \]
Therefore
\begin{align*} \left (-1+y\right )\mathop {\mathrm {d}y} &= \left (-1\right )\mathop {\mathrm {d}t}\\ \left (1\right )\mathop {\mathrm {d}t} + \left (-1+y\right )\mathop {\mathrm {d}y} &= 0 \tag {2A} \end{align*}

Comparing (1A) and (2A) shows that

\begin{align*} M(t,y) &= 1\\ N(t,y) &= -1+y \end{align*}

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied

\[ \frac {\partial M}{\partial y} = \frac {\partial N}{\partial t} \]
Using result found above gives
\begin{align*} \frac {\partial M}{\partial y} &= \frac {\partial }{\partial y} \left (1\right )\\ &= 0 \end{align*}

And

\begin{align*} \frac {\partial N}{\partial t} &= \frac {\partial }{\partial t} \left (-1+y\right )\\ &= 0 \end{align*}

Since \(\frac {\partial M}{\partial y}= \frac {\partial N}{\partial t}\), then the ODE is exact The following equations are now set up to solve for the function \(\phi \left (t,y\right )\)

\begin{align*} \frac {\partial \phi }{\partial t } &= M\tag {1} \\ \frac {\partial \phi }{\partial y } &= N\tag {2} \end{align*}

Integrating (1) w.r.t. \(t\) gives

\begin{align*} \int \frac {\partial \phi }{\partial t} \mathop {\mathrm {d}t} &= \int M\mathop {\mathrm {d}t} \\ \int \frac {\partial \phi }{\partial t} \mathop {\mathrm {d}t} &= \int 1\mathop {\mathrm {d}t} \\ \tag{3} \phi &= t+ f(y) \\ \end{align*}
Where \(f(y)\) is used for the constant of integration since \(\phi \) is a function of both \(t\) and \(y\). Taking derivative of equation (3) w.r.t \(y\) gives
\begin{equation} \tag{4} \frac {\partial \phi }{\partial y} = 0+f'(y) \end{equation}
But equation (2) says that \(\frac {\partial \phi }{\partial y} = -1+y\). Therefore equation (4) becomes
\begin{equation} \tag{5} -1+y = 0+f'(y) \end{equation}
Solving equation (5) for \( f'(y)\) gives
\[ f'(y) = -1+y \]
Integrating the above w.r.t \(y\) gives
\begin{align*} \int f'(y) \mathop {\mathrm {d}y} &= \int \left ( -1+y\right ) \mathop {\mathrm {d}y} \\ f(y) &= -y +\frac {1}{2} y^{2}+ c_1 \\ \end{align*}
Where \(c_1\) is constant of integration. Substituting result found above for \(f(y)\) into equation (3) gives \(\phi \)
\[ \phi = t -y +\frac {1}{2} y^{2}+ c_1 \]
But since \(\phi \) itself is a constant function, then let \(\phi =c_2\) where \(c_2\) is new constant and combining \(c_1\) and \(c_2\) constants into the constant \(c_1\) gives the solution as
\[ c_1 = t -y +\frac {1}{2} y^{2} \]
Solving for initial conditions the solution is
\begin{align*} t -y+\frac {y^{2}}{2} &= 0 \\ \end{align*}
Solving for \(y\) gives
\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
Solution plot Slope field \(y^{\prime } = \frac {1}{1-y}\)

Summary of solutions found

\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
2.1.32.4 Solved using first_order_ode_dAlembert

0.106 (sec)

Entering first order ode dAlembert solver

\begin{align*} y^{\prime }&=\frac {1}{1-y} \\ y \left (0\right ) &= 2 \\ \end{align*}
Let \(p=y^{\prime }\) the ode becomes
\begin{align*} p = \frac {1}{1-y} \end{align*}

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

\begin{align*} \tag{1} y &= \frac {p -1}{p} \\ \end{align*}
This has the form
\begin{align*} y=t f(p)+g(p)\tag {*} \end{align*}

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

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

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

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

\begin{align*} f &= 0\\ g &= \frac {p -1}{p} \end{align*}

Hence (2) becomes

\begin{equation} \tag{2A} p = \frac {p^{\prime }\left (t \right )}{p^{2}} \end{equation}
The singular solution is found by setting \(\frac {dp}{dt}=0\) in the above which gives
\begin{align*} p = 0 \end{align*}

No valid singular solutions found.

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

\begin{equation} \tag{3} p^{\prime }\left (t \right ) = p \left (t \right )^{3} \end{equation}
This ODE is now solved for \(p \left (t \right )\). No inversion is needed.

Integrating gives

\begin{align*} \int \frac {1}{p^{3}}d p &= dt\\ -\frac {1}{2 p^{2}}&= t +c_1 \end{align*}

Singular solutions are found by solving

\begin{align*} p^{3}&= 0 \end{align*}

for \(p \left (t \right )\). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

\begin{align*} p \left (t \right ) = 0 \end{align*}

Substituing the above solution for \(p\) in (2A) gives

\begin{align*} y &= -\left (-\frac {1}{\sqrt {-2 c_1 -2 t}}-1\right ) \sqrt {-2 c_1 -2 t} \\ \end{align*}
Simplifying the above gives
\begin{align*} y &= 1+\sqrt {-2 c_1 -2 t} \\ \end{align*}
Solving for initial conditions the solution is
\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
Solution plot Slope field \(y^{\prime } = \frac {1}{1-y}\)

Summary of solutions found

\begin{align*} y &= 1+\sqrt {1-2 t} \\ \end{align*}
2.1.32.5 Maple. Time used: 0.045 (sec). Leaf size: 13
ode:=diff(y(t),t) = 1/(1-y(t)); 
ic:=[y(0) = 2]; 
dsolve([ode,op(ic)],y(t), singsol=all);
 
\[ y = 1+\sqrt {1-2 t} \]

Maple trace

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

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [\frac {d}{d t}y \left (t \right )=\frac {1}{1-y \left (t \right )}, y \left (0\right )=2\right ] \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d t}y \left (t \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d t}y \left (t \right )=\frac {1}{1-y \left (t \right )} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \left (\frac {d}{d t}y \left (t \right )\right ) \left (1-y \left (t \right )\right )=1 \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int \left (\frac {d}{d t}y \left (t \right )\right ) \left (1-y \left (t \right )\right )d t =\int 1d t +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & y \left (t \right )-\frac {y \left (t \right )^{2}}{2}=t +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \left (t \right ) \\ {} & {} & \left \{y \left (t \right )=1-\sqrt {1-2 \mathit {C1} -2 t}, y \left (t \right )=1+\sqrt {1-2 \mathit {C1} -2 t}\right \} \\ \bullet & {} & \textrm {Redefine the integration constant(s)}\hspace {3pt} \\ {} & {} & \left \{y \left (t \right )=1-\sqrt {-2 t +\mathit {C1}}, y \left (t \right )=1+\sqrt {-2 t +\mathit {C1}}\right \} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=2 \\ {} & {} & 2=1-\sqrt {\mathit {C1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \textrm {No solution}\hspace {3pt} \\ \bullet & {} & \textrm {Solution does not satisfy initial condition}\hspace {3pt} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=2 \\ {} & {} & 2=1+\sqrt {\mathit {C1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =1 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_C1} =1\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y \left (t \right )=1+\sqrt {-2 t +1} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y \left (t \right )=1+\sqrt {-2 t +1} \end {array} \]
2.1.32.6 Mathematica. Time used: 0.002 (sec). Leaf size: 16
ode=D[y[t],t]==1/(1-y[t]); 
ic=y[0]==2; 
DSolve[{ode,ic},y[t],t,IncludeSingularSolutions->True]
 
\begin{align*} y(t)&\to \sqrt {1-2 t}+1 \end{align*}
2.1.32.7 Sympy. Time used: 0.238 (sec). Leaf size: 12
from sympy import * 
t = symbols("t") 
y = Function("y") 
ode = Eq(Derivative(y(t), t) - 1/(1 - y(t)),0) 
ics = {y(0): 2} 
dsolve(ode,func=y(t),ics=ics)
                                                                                  
                                                                                  
 
\[ y{\left (t \right )} = \sqrt {1 - 2 t} + 1 \]