2.1.46 problem 46

Solved as first order autonomous ode
Solved as first order Bernoulli ode
Solved as first order Exact ode
Solved using Lie symmetry for first order ode
Solved as first order ode of type dAlembert
Maple step by step solution
Maple trace
Maple dsolve solution
Mathematica DSolve solution

Internal problem ID [8184]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 46
Date solved : Sunday, November 10, 2024 at 08:20:00 PM
CAS classification : [_quadrature]

Solve

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

Solved as first order autonomous ode

Time used: 0.145 (sec)

Integrating gives

\begin{align*} \int f d f &= dx\\ \frac {f^{2}}{2}&= x +c_1 \end{align*}

Solving for \(f\) gives

\begin{align*} f &= \sqrt {2 c_1 +2 x} \\ f &= -\sqrt {2 c_1 +2 x} \\ \end{align*}
Figure 2.102: Slope field plot
\(f^{\prime } = \frac {1}{f}\)

Summary of solutions found

\begin{align*} f &= \sqrt {2 c_1 +2 x} \\ f &= -\sqrt {2 c_1 +2 x} \\ \end{align*}
Solved as first order Bernoulli ode

Time used: 0.089 (sec)

In canonical form, the ODE is

\begin{align*} f' &= F(x,f)\\ &= \frac {1}{f} \end{align*}

This is a Bernoulli ODE.

\[ f' = \left (1\right ) \frac {1}{f} \tag {1} \]

The standard Bernoulli ODE has the form

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

Comparing this to (1) shows that

\begin{align*} f_0 &=0\\ f_1 &=1 \end{align*}

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

\[ \frac {f'}{f^n} = f_1(x) \tag {3} \]

The next step is use the substitution \(v = f^{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 \(f(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)&=0\\ f_1(x)&=1\\ n &=-1 \end{align*}

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

\begin{align*} f'f &= 0 +1 \tag {4} \end{align*}

Let

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

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

\begin{align*} v' &= 2 ff' \tag {6} \end{align*}

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

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

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

Since the ode has the form \(v^{\prime }\left (x \right )=f(x)\), then we only need to integrate \(f(x)\).

\begin{align*} \int {dv} &= \int {2\, dx}\\ v \left (x \right ) &= 2 x + c_1 \end{align*}

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

\[ f^{2} = 2 x +c_1 \]

Solving for \(f\) gives

\begin{align*} f &= \sqrt {2 x +c_1} \\ f &= -\sqrt {2 x +c_1} \\ \end{align*}
Figure 2.103: Slope field plot
\(f^{\prime } = \frac {1}{f}\)

Summary of solutions found

\begin{align*} f &= \sqrt {2 x +c_1} \\ f &= -\sqrt {2 x +c_1} \\ \end{align*}
Solved as first order Exact ode

Time used: 0.070 (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(x,f) \mathop {\mathrm {d}x}+ N(x,f) \mathop {\mathrm {d}f}=0 \tag {1A} \]

Therefore

\begin{align*} \left (f\right )\mathop {\mathrm {d}f} &= \mathop {\mathrm {d}x}\\ - \mathop {\mathrm {d}x}+\left ( f\right )\mathop {\mathrm {d}f} &= 0 \tag {2A} \end{align*}

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

\begin{align*} M(x,f) &= -1\\ N(x,f) &= f \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 f} = \frac {\partial N}{\partial x} \]

Using result found above gives

\begin{align*} \frac {\partial M}{\partial f} &= \frac {\partial }{\partial f} \left (-1\right )\\ &= 0 \end{align*}

And

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

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

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

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

\begin{align*} \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int M\mathop {\mathrm {d}x} \\ \int \frac {\partial \phi }{\partial x} \mathop {\mathrm {d}x} &= \int -1\mathop {\mathrm {d}x} \\ \tag{3} \phi &= -x+ f(f) \\ \end{align*}

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

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

But equation (2) says that \(\frac {\partial \phi }{\partial f} = f\). Therefore equation (4) becomes

\begin{equation} \tag{5} f = 0+f'(f) \end{equation}

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

\[ f'(f) = f \]

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

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

Where \(c_1\) is constant of integration. Substituting result found above for \(f(f)\) into equation (3) gives \(\phi \)

\[ \phi = -x +\frac {f^{2}}{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 = -x +\frac {f^{2}}{2} \]

Solving for \(f\) gives

\begin{align*} f &= \sqrt {2 c_1 +2 x} \\ f &= -\sqrt {2 c_1 +2 x} \\ \end{align*}
Figure 2.104: Slope field plot
\(f^{\prime } = \frac {1}{f}\)

Summary of solutions found

\begin{align*} f &= \sqrt {2 c_1 +2 x} \\ f &= -\sqrt {2 c_1 +2 x} \\ \end{align*}
Solved using Lie symmetry for first order ode

Time used: 0.404 (sec)

Writing the ode as

\begin{align*} f^{\prime }&=\frac {1}{f}\\ f^{\prime }&= \omega \left ( x,f\right ) \end{align*}

The condition of Lie symmetry is the linearized PDE given by

\begin{align*} \eta _{x}+\omega \left ( \eta _{f}-\xi _{x}\right ) -\omega ^{2}\xi _{f}-\omega _{x}\xi -\omega _{f}\eta =0\tag {A} \end{align*}

To determine \(\xi ,\eta \) then (A) is solved using ansatz. Making bivariate polynomials of degree 1 to use as anstaz gives

\begin{align*} \tag{1E} \xi &= f a_{3}+x a_{2}+a_{1} \\ \tag{2E} \eta &= f b_{3}+x b_{2}+b_{1} \\ \end{align*}

Where the unknown coefficients are

\[ \{a_{1}, a_{2}, a_{3}, b_{1}, b_{2}, b_{3}\} \]

Substituting equations (1E,2E) and \(\omega \) into (A) gives

\begin{equation} \tag{5E} b_{2}+\frac {b_{3}-a_{2}}{f}-\frac {a_{3}}{f^{2}}+\frac {f b_{3}+x b_{2}+b_{1}}{f^{2}} = 0 \end{equation}

Putting the above in normal form gives

\[ \frac {b_{2} f^{2}-f a_{2}+2 f b_{3}+x b_{2}-a_{3}+b_{1}}{f^{2}} = 0 \]

Setting the numerator to zero gives

\begin{equation} \tag{6E} b_{2} f^{2}-f a_{2}+2 f b_{3}+x b_{2}-a_{3}+b_{1} = 0 \end{equation}

Looking at the above PDE shows the following are all the terms with \(\{f, x\}\) in them.

\[ \{f, x\} \]

The following substitution is now made to be able to collect on all terms with \(\{f, x\}\) in them

\[ \{f = v_{1}, x = v_{2}\} \]

The above PDE (6E) now becomes

\begin{equation} \tag{7E} b_{2} v_{1}^{2}-a_{2} v_{1}+b_{2} v_{2}+2 b_{3} v_{1}-a_{3}+b_{1} = 0 \end{equation}

Collecting the above on the terms \(v_i\) introduced, and these are

\[ \{v_{1}, v_{2}\} \]

Equation (7E) now becomes

\begin{equation} \tag{8E} b_{2} v_{1}^{2}+\left (-a_{2}+2 b_{3}\right ) v_{1}+b_{2} v_{2}-a_{3}+b_{1} = 0 \end{equation}

Setting each coefficients in (8E) to zero gives the following equations to solve

\begin{align*} b_{2}&=0\\ -a_{2}+2 b_{3}&=0\\ -a_{3}+b_{1}&=0 \end{align*}

Solving the above equations for the unknowns gives

\begin{align*} a_{1}&=a_{1}\\ a_{2}&=2 b_{3}\\ a_{3}&=b_{1}\\ b_{1}&=b_{1}\\ b_{2}&=0\\ b_{3}&=b_{3} \end{align*}

Substituting the above solution in the anstaz (1E,2E) (using \(1\) as arbitrary value for any unknown in the RHS) gives

\begin{align*} \xi &= 1 \\ \eta &= 0 \\ \end{align*}

Shifting is now applied to make \(\xi =0\) in order to simplify the rest of the computation

\begin{align*} \eta &= \eta - \omega \left (x,f\right ) \xi \\ &= 0 - \left (\frac {1}{f}\right ) \left (1\right ) \\ &= -\frac {1}{f}\\ \xi &= 0 \end{align*}

The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( x,f\right ) \to \left ( R,S \right )\) where \(\left ( R,S \right )\) are the canonical coordinates which make the original ode become a quadrature and hence solved by integration.

The characteristic pde which is used to find the canonical coordinates is

\begin{align*} \frac {d x}{\xi } &= \frac {d f}{\eta } = dS \tag {1} \end{align*}

The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial x} + \eta \frac {\partial }{\partial f}\right ) S(x,f) = 1\). Starting with the first pair of ode’s in (1) gives an ode to solve for the independent variable \(R\) in the canonical coordinates, where \(S(R)\). Since \(\xi =0\) then in this special case

\begin{align*} R = x \end{align*}

\(S\) is found from

\begin{align*} S &= \int { \frac {1}{\eta }} dy\\ &= \int { \frac {1}{-\frac {1}{f}}} dy \end{align*}

Which results in

\begin{align*} S&= -\frac {f^{2}}{2} \end{align*}

Now that \(R,S\) are found, we need to setup the ode in these coordinates. This is done by evaluating

\begin{align*} \frac {dS}{dR} &= \frac { S_{x} + \omega (x,f) S_{f} }{ R_{x} + \omega (x,f) R_{f} }\tag {2} \end{align*}

Where in the above \(R_{x},R_{f},S_{x},S_{f}\) are all partial derivatives and \(\omega (x,f)\) is the right hand side of the original ode given by

\begin{align*} \omega (x,f) &= \frac {1}{f} \end{align*}

Evaluating all the partial derivatives gives

\begin{align*} R_{x} &= 1\\ R_{f} &= 0\\ S_{x} &= 0\\ S_{f} &= -f \end{align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.

\begin{align*} \frac {dS}{dR} &= -1\tag {2A} \end{align*}

We now need to express the RHS as function of \(R\) only. This is done by solving for \(x,f\) in terms of \(R,S\) from the result obtained earlier and simplifying. This gives

\begin{align*} \frac {dS}{dR} &= -1 \end{align*}

The above is a quadrature ode. This is the whole point of Lie symmetry method. It converts an ode, no matter how complicated it is, to one that can be solved by integration when the ode is in the canonical coordiates \(R,S\).

Since the ode has the form \(\frac {d}{d R}S \left (R \right )=f(R)\), then we only need to integrate \(f(R)\).

\begin{align*} \int {dS} &= \int {-1\, dR}\\ S \left (R \right ) &= -R + c_2 \end{align*}

To complete the solution, we just need to transform the above back to \(x,f\) coordinates. This results in

\begin{align*} -\frac {f^{2}}{2} = -x +c_2 \end{align*}

The following diagram shows solution curves of the original ode and how they transform in the canonical coordinates space using the mapping shown.

Original ode in \(x,f\) coordinates

Canonical coordinates transformation

ODE in canonical coordinates \((R,S)\)

\( \frac {df}{dx} = \frac {1}{f}\)

\( \frac {d S}{d R} = -1\)

\(\!\begin {aligned} R&= x\\ S&= -\frac {f^{2}}{2} \end {aligned} \)

Solving for \(f\) gives

\begin{align*} f &= \sqrt {-2 c_2 +2 x} \\ f &= -\sqrt {-2 c_2 +2 x} \\ \end{align*}
Figure 2.105: Slope field plot
\(f^{\prime } = \frac {1}{f}\)

Summary of solutions found

\begin{align*} f &= \sqrt {-2 c_2 +2 x} \\ f &= -\sqrt {-2 c_2 +2 x} \\ \end{align*}
Solved as first order ode of type dAlembert

Time used: 0.072 (sec)

Let \(p=f^{\prime }\) the ode becomes

\begin{align*} p = \frac {1}{f} \end{align*}

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

\begin{align*} \tag{1} f &= \frac {1}{p} \\ \end{align*}

This has the form

\begin{align*} f=xf(p)+g(p)\tag {*} \end{align*}

Where \(f,g\) are functions of \(p=f'(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 \(f=x f + g\) to (1A) shows that

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

Hence (2) becomes

\begin{align*} p = -\frac {p^{\prime }\left (x \right )}{p^{2}}\tag {2A} \end{align*}

The singular solution is found by setting \(\frac {dp}{dx}=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}x}}\neq 0\). From eq. (2A). This results in

\begin{align*} p^{\prime }\left (x \right ) = -p \left (x \right )^{3}\tag {3} \end{align*}

Inverting the above ode gives

\begin{align*} \frac {d}{d p}x \left (p \right ) = -\frac {1}{p^{3}}\tag {4} \end{align*}

This ODE is now solved for \(x \left (p \right )\). Integrating gives

\begin{align*} x \left (p \right )&=\int -\frac {1}{p^{3}}d p +c_1\\ x \left (p \right )&=\frac {1}{2 p^{2}}+c_1\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 {1}{2 p^{2}}+c_1 \\ f &= \frac {1}{p} \\ \end{align*}

results in

\begin{align*} p &= \operatorname {RootOf}\left (1+\left (2 c_1 -2 x \right ) \textit {\_Z}^{2}\right ) \\ \end{align*}

Substituting the above into Eq (1A) and simplifying gives

\begin{align*} f &= \frac {1}{\operatorname {RootOf}\left (1+\left (2 c_1 -2 x \right ) \textit {\_Z}^{2}\right )} \\ \end{align*}
Figure 2.106: Slope field plot
\(f^{\prime } = \frac {1}{f}\)

Summary of solutions found

\begin{align*} f &= \frac {1}{\operatorname {RootOf}\left (1+\left (2 c_1 -2 x \right ) \textit {\_Z}^{2}\right )} \\ \end{align*}
Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \frac {d}{d x}f \left (x \right )=\frac {1}{f \left (x \right )} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}f \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}f \left (x \right )=\frac {1}{f \left (x \right )} \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & f \left (x \right ) \left (\frac {d}{d x}f \left (x \right )\right )=1 \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} x \\ {} & {} & \int f \left (x \right ) \left (\frac {d}{d x}f \left (x \right )\right )d x =\int 1d x +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & \frac {f \left (x \right )^{2}}{2}=x +\mathit {C1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} f \left (x \right ) \\ {} & {} & \left \{f \left (x \right )=\sqrt {2 x +2 \mathit {C1}}, f \left (x \right )=-\sqrt {2 x +2 \mathit {C1}}\right \} \end {array} \]

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

Solving time : 0.006 (sec)
Leaf size : 23

dsolve(diff(f(x),x) = 1/f(x), 
       f(x),singsol=all)
 
\begin{align*} f &= \sqrt {c_{1} +2 x} \\ f &= -\sqrt {c_{1} +2 x} \\ \end{align*}
Mathematica DSolve solution

Solving time : 0.063 (sec)
Leaf size : 38

DSolve[{D[ f[x],x]==f[x]^(-1),{}}, 
       f[x],x,IncludeSingularSolutions->True]
 
\begin{align*} f(x)\to -\sqrt {2} \sqrt {x+c_1} \\ f(x)\to \sqrt {2} \sqrt {x+c_1} \\ \end{align*}