1.32 problem 33

1.32.1 Existence and uniqueness analysis
1.32.2 Solved as first order quadrature ode
1.32.3 Solved as first order Exact ode
1.32.4 Maple step by step solution
1.32.5 Maple trace
1.32.6 Maple dsolve solution
1.32.7 Mathematica DSolve solution

Internal problem ID [7724]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 33
Date solved : Monday, October 21, 2024 at 03:59:18 PM
CAS classification : [_quadrature]

Solve

\begin{align*} y^{\prime }&=\frac {1}{1-y} \end{align*}

With initial conditions

\begin{align*} y \left (0\right )&=2 \end{align*}

1.32.1 Existence and uniqueness analysis

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.

1.32.2 Solved as first order quadrature ode

Time used: 0.089 (sec)

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 the constant of integration from initial conditions, the solution becomes

\begin{align*} y-\frac {y^{2}}{2} = t \end{align*}
Figure 75: Slope field plot
\(y^{\prime } = \frac {1}{1-y}\)
1.32.3 Solved as first order Exact ode

Time used: 0.069 (sec)

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 the constant of integration from initial conditions, the solution becomes

\begin{align*} t -y+\frac {y^{2}}{2} = 0 \end{align*}
Figure 76: Slope field plot
\(y^{\prime } = \frac {1}{1-y}\)
1.32.4 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \left [y^{\prime }=\frac {1}{1-y}, y \left (0\right )=2\right ] \\ \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} \\ {} & {} & y^{\prime }=\frac {1}{1-y} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & y^{\prime } \left (1-y\right )=1 \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} t \\ {} & {} & \int y^{\prime } \left (1-y\right )d t =\int 1d t +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & y-\frac {y^{2}}{2}=t +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} y \\ {} & {} & \left \{y=1-\sqrt {1-2 \mathit {C1} -2 t}, y=1+\sqrt {1-2 \mathit {C1} -2 t}\right \} \\ \bullet & {} & \textrm {Use initial condition}\hspace {3pt} y \left (0\right )=2 \\ {} & {} & 2=1-\sqrt {1-2 \mathit {C1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =\left (\right ) \\ \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 {1-2 \mathit {C1}} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} \textit {\_C1} \\ {} & {} & \mathit {C1} =0 \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \textit {\_C1} =0\hspace {3pt}\textrm {into general solution and simplify}\hspace {3pt} \\ {} & {} & y=1+\sqrt {1-2 t} \\ \bullet & {} & \textrm {Solution to the IVP}\hspace {3pt} \\ {} & {} & y=1+\sqrt {1-2 t} \end {array} \]

1.32.5 Maple trace
Methods for first order ODEs:
 
1.32.6 Maple dsolve solution

Solving time : 0.035 (sec)
Leaf size : 13

dsolve([diff(y(t),t) = 1/(1-y(t)), 
       op([y(0) = 2])],y(t),singsol=all)
 
\[ y = 1+\sqrt {1-2 t} \]
1.32.7 Mathematica DSolve solution

Solving time : 0.003 (sec)
Leaf size : 16

DSolve[{D[y[t],t]==1/(1-y[t]),y[0]==2}, 
       y[t],t,IncludeSingularSolutions->True]
 
\[ y(t)\to \sqrt {1-2 t}+1 \]