2.1.8.3 Solved using first_order_ode_exact

Entering first order ode exact solver

\[\begin {aligned} x^{\prime }&=b \,{\mathrm e}^{x}\\ x \left (0\right ) &= 1\\ \end {aligned}\]

A differential equation of of the form

\begin{align*} M\left ( x,y\right ) +N\left ( x,y\right ) \frac {dy}{dx}&=0\tag {A} \end{align*}

is solved by assuming 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

\begin{align*} \frac {d}{dx}\phi \left ( x,y\right ) &=0 \end{align*}

Therefore

\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*}

Since \(\frac {\partial ^{2}\phi }{\partial x\partial y}=\frac {\partial ^{2}\phi }{\partial y\partial x}\) then for the above to be valid the following condition is required

\[ \frac {\partial M}{\partial y}=\frac {\partial N}{\partial x}\]

if the above condition is satisfied, the original ode is called exact.

The function \(\phi \left ( x,y\right ) \) needs to be determined. If this condition is not satisfied this method will not work. In this case an integrating factor might exist to force this condition to be satisfied.

The first step is to write the ODE in following standard form and then check for exactness.

\[ M(t,x) \mathop {\mathrm {d}t}+ N(t,x) \mathop {\mathrm {d}x}=0 \tag {1A} \]

The given ODE becomes

\begin{align*} \mathop {\mathrm {d}x} &= \left (b \,{\mathrm e}^{x}\right )\mathop {\mathrm {d}t}\\ \left (-b \,{\mathrm e}^{x}\right ) \mathop {\mathrm {d}t} + \mathop {\mathrm {d}x} &= 0 \tag {2A} \end{align*}

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

\begin{align*} M(t,x) &= -b \,{\mathrm e}^{x}\\ N(t,x) &= 1 \end{align*}

The ODE is now checked if it is exact or not. An ODE is exact if the following condition is satisfied

\[ \frac {\partial M}{\partial x} = \frac {\partial N}{\partial t} \]

Therefore

\begin{align*} \frac {\partial M}{\partial x} &= \frac {\partial }{\partial x} \left (-b \,{\mathrm e}^{x}\right )\\ &= -b \,{\mathrm e}^{x} \end{align*}

and

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

Since \(\frac {\partial M}{\partial x} \neq \frac {\partial N}{\partial t}\), the ODE is not exact.

Because the ODE is not exact, need to find an integrating factor to make it exact. Let

\begin{align*} A &= \frac {1}{N} \left (\frac {\partial M}{\partial x} - \frac {\partial N}{\partial t} \right ) \\ &=1\left ( \left ( -b \,{\mathrm e}^{x}\right ) - \left (0 \right ) \right ) \\ &=-b \,{\mathrm e}^{x} \end{align*}

Since \(A\) depends on \(x\), it can not be used to obtain an integrating factor. We will now try a second method to find an integrating factor. Let

\begin{align*} B &= \frac {1}{M} \left ( \frac {\partial N}{\partial t} - \frac {\partial M}{\partial x} \right ) \\ &=-\frac {{\mathrm e}^{-x}}{b}\left ( \left ( 0\right ) - \left (-b \,{\mathrm e}^{x} \right ) \right ) \\ &=-1 \end{align*}

Since \(B\) does not depend on \(t\), it can be used to obtain an integrating factor. Let the integrating factor be \(\mu \). Then

\begin{align*} \mu &= e^{\int B \mathop {\mathrm {d}x}} \\ &= e^{\int -1\mathop {\mathrm {d}x} } \end{align*}

The result of integrating gives

\begin{align*} \mu &= e^{-x } \\ &= {\mathrm e}^{-x} \end{align*}

\(M\) and \(N\) are now multiplied by this integrating factor, giving new \(M\) and new \(N\) which are called \(\overline {M}\) and \(\overline {N}\) so not to confuse them with the original \(M\) and \(N\).

\begin{align*} \overline {M} &=\mu M \\ &= {\mathrm e}^{-x}\left (-b \,{\mathrm e}^{x}\right ) \\ &= -b \end{align*}

and

\begin{align*} \overline {N} &=\mu N \\ &= {\mathrm e}^{-x}\left (1\right ) \\ &= {\mathrm e}^{-x} \end{align*}

So now a modified ODE is obtained from the original ODE which will be exact and can be solved using the standard method. The modified ODE is

\begin{align*} \overline {M} + \overline {N} \frac { \mathop {\mathrm {d}x}}{\mathop {\mathrm {d}t}} &= 0 \\ \left (-b\right ) + \left ({\mathrm e}^{-x}\right ) \frac { \mathop {\mathrm {d}x}}{\mathop {\mathrm {d}t}} &= 0 \end{align*}

The following equations are set up to find the function \(\phi \left (t,x\right )\)

\begin{align*} \frac {\partial \phi }{\partial t } &= \overline {M}\tag {1} \\ \frac {\partial \phi }{\partial x } &= \overline {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 \overline {M}\mathop {\mathrm {d}t}\\ \int \frac {\partial \phi }{\partial t} \mathop {\mathrm {d}t} &= \int -b\mathop {\mathrm {d}t}\\ \phi &= -t b+ f(x)\tag {3} \end{align*}

Where \(f(x)\) is used for the constant of integration because \(\phi \) is a function of both \(t\) and \(x\). Taking derivative of (3) w.r.t \(x\) gives

\begin{align*} \frac {\partial \phi }{\partial x} = 0+f'(x)\tag {4} \end{align*}

But equation (2) says that \(\frac {\partial \phi }{\partial x} = {\mathrm e}^{-x}\). Therefore equation (4) becomes

\begin{align*} {\mathrm e}^{-x} &= 0+f'(x)\tag {5} \end{align*}

Solving equation (5) for \( f'(x)\) gives

\begin{align*} f'(x) &= {\mathrm e}^{-x} \end{align*}

Integrating the above w.r.t \(x\) gives

\begin{align*} \int f'(x) \mathop {\mathrm {d}x} &= \int \left ( {\mathrm e}^{-x}\right ) \mathop {\mathrm {d}x}\\ f(x) &= -{\mathrm e}^{-x}+ c_1 \end{align*}

Eq(3) becomes

\begin{align*} \phi &= -t b -{\mathrm e}^{-x}+ c_1 \end{align*}

Since \(\phi \) is a constant function, then by combining constants the above simplifies to

\begin{align*} c_1 &= -t b -{\mathrm e}^{-x} \end{align*}

Applying the initial condition \(x \left (0\right ) = 1\), the solution becomes

\begin{align*} -t b -{\mathrm e}^{-x} &= -{\mathrm e}^{-1} \\ \end{align*}

Solving for \(x\) from \(-t b -{\mathrm e}^{-x} = -{\mathrm e}^{-1}\) gives

\begin{align*} x &= -\ln \left (-\left (t b \,{\mathrm e}-1\right ) {\mathrm e}^{-1}\right ) \\ \end{align*}

Simplifying the above gives

\[ x = -\ln \left (-t b +{\mathrm e}^{-1}\right ) \]

Summary of solutions found

\[ x = -\ln \left (-t b +{\mathrm e}^{-1}\right ) \]