6.16 problem 16

6.16.1 Solving as linear ode
6.16.2 Solving as first order ode lie symmetry lookup ode
6.16.3 Solving as exact ode
6.16.4 Maple step by step solution

Internal problem ID [2002]
Internal file name [OUTPUT/2002_Sunday_February_25_2024_06_44_25_AM_31396177/index.tex]

Book: Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section: Exercise 10, page 41
Problem number: 16.
ODE order: 1.
ODE degree: 1.

The type(s) of ODE detected by this program : "linear", "exactWithIntegrationFactor", "first_order_ode_lie_symmetry_lookup"

Maple gives the following as the ode type

[_linear]

\[ \boxed {\cos \left (\theta \right ) r^{\prime }-2 r \sin \left (\theta \right )=2} \]

6.16.1 Solving as linear ode

Entering Linear first order ODE solver. In canonical form a linear first order is \begin {align*} r^{\prime } + p(\theta )r &= q(\theta ) \end {align*}

Where here \begin {align*} p(\theta ) &=-\frac {2 \sin \left (\theta \right )}{\cos \left (\theta \right )}\\ q(\theta ) &=\frac {2}{\cos \left (\theta \right )} \end {align*}

Hence the ode is \begin {align*} r^{\prime }-\frac {2 \sin \left (\theta \right ) r}{\cos \left (\theta \right )} = \frac {2}{\cos \left (\theta \right )} \end {align*}

The integrating factor \(\mu \) is \begin{align*} \mu &= {\mathrm e}^{\int -\frac {2 \sin \left (\theta \right )}{\cos \left (\theta \right )}d \theta } \\ &= \cos \left (\theta \right )^{2} \\ \end{align*} The ode becomes \begin {align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\theta }}\left ( \mu r\right ) &= \left (\mu \right ) \left (\frac {2}{\cos \left (\theta \right )}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}\theta }} \left (r \cos \left (\theta \right )^{2}\right ) &= \left (\cos \left (\theta \right )^{2}\right ) \left (\frac {2}{\cos \left (\theta \right )}\right )\\ \mathrm {d} \left (r \cos \left (\theta \right )^{2}\right ) &= \left (2 \cos \left (\theta \right )\right )\, \mathrm {d} \theta \end {align*}

Integrating gives \begin {align*} r \cos \left (\theta \right )^{2} &= \int {2 \cos \left (\theta \right )\,\mathrm {d} \theta }\\ r \cos \left (\theta \right )^{2} &= 2 \sin \left (\theta \right ) + c_{1} \end {align*}

Dividing both sides by the integrating factor \(\mu =\cos \left (\theta \right )^{2}\) results in \begin {align*} r &= 2 \sec \left (\theta \right )^{2} \sin \left (\theta \right )+c_{1} \sec \left (\theta \right )^{2} \end {align*}

which simplifies to \begin {align*} r &= \sec \left (\theta \right )^{2} \left (2 \sin \left (\theta \right )+c_{1} \right ) \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} r &= \sec \left (\theta \right )^{2} \left (2 \sin \left (\theta \right )+c_{1} \right ) \\ \end{align*}

Figure 273: Slope field plot

Verification of solutions

\[ r = \sec \left (\theta \right )^{2} \left (2 \sin \left (\theta \right )+c_{1} \right ) \] Verified OK.

6.16.2 Solving as first order ode lie symmetry lookup ode

Writing the ode as \begin {align*} r^{\prime }&=\frac {2+2 r \sin \left (\theta \right )}{\cos \left (\theta \right )}\\ r^{\prime }&= \omega \left ( \theta ,r\right ) \end {align*}

The condition of Lie symmetry is the linearized PDE given by \begin {align*} \eta _{\theta }+\omega \left ( \eta _{r}-\xi _{\theta }\right ) -\omega ^{2}\xi _{r}-\omega _{\theta }\xi -\omega _{r}\eta =0\tag {A} \end {align*}

The type of this ode is known. It is of type linear. Therefore we do not need to solve the PDE (A), and can just use the lookup table shown below to find \(\xi ,\eta \)

Table 113: Lie symmetry infinitesimal lookup table for known first order ODE’s

ODE class

Form

\(\xi \)

\(\eta \)

linear ode

\(y'=f(x) y(x) +g(x)\)

\(0\)

\(e^{\int fdx}\)

separable ode

\(y^{\prime }=f\left ( x\right ) g\left ( y\right ) \)

\(\frac {1}{f}\)

\(0\)

quadrature ode

\(y^{\prime }=f\left ( x\right ) \)

\(0\)

\(1\)

quadrature ode

\(y^{\prime }=g\left ( y\right ) \)

\(1\)

\(0\)

homogeneous ODEs of Class A

\(y^{\prime }=f\left ( \frac {y}{x}\right ) \)

\(x\)

\(y\)

homogeneous ODEs of Class C

\(y^{\prime }=\left ( a+bx+cy\right ) ^{\frac {n}{m}}\)

\(1\)

\(-\frac {b}{c}\)

homogeneous class D

\(y^{\prime }=\frac {y}{x}+g\left ( x\right ) F\left (\frac {y}{x}\right ) \)

\(x^{2}\)

\(xy\)

First order special form ID 1

\(y^{\prime }=g\left ( x\right ) e^{h\left (x\right ) +by}+f\left ( x\right ) \)

\(\frac {e^{-\int bf\left ( x\right )dx-h\left ( x\right ) }}{g\left ( x\right ) }\)

\(\frac {f\left ( x\right )e^{-\int bf\left ( x\right ) dx-h\left ( x\right ) }}{g\left ( x\right ) }\)

polynomial type ode

\(y^{\prime }=\frac {a_{1}x+b_{1}y+c_{1}}{a_{2}x+b_{2}y+c_{2}}\)

\(\frac {a_{1}b_{2}x-a_{2}b_{1}x-b_{1}c_{2}+b_{2}c_{1}}{a_{1}b_{2}-a_{2}b_{1}}\)

\(\frac {a_{1}b_{2}y-a_{2}b_{1}y-a_{1}c_{2}-a_{2}c_{1}}{a_{1}b_{2}-a_{2}b_{1}}\)

Bernoulli ode

\(y^{\prime }=f\left ( x\right ) y+g\left ( x\right ) y^{n}\)

\(0\)

\(e^{-\int \left ( n-1\right ) f\left ( x\right ) dx}y^{n}\)

Reduced Riccati

\(y^{\prime }=f_{1}\left ( x\right ) y+f_{2}\left ( x\right )y^{2}\)

\(0\)

\(e^{-\int f_{1}dx}\)

The above table shows that \begin {align*} \xi \left (\theta ,r\right ) &=0\\ \tag {A1} \eta \left (\theta ,r\right ) &=\frac {1}{\cos \left (\theta \right )^{2}} \end {align*}

The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( \theta ,r\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 \theta }{\xi } &= \frac {d r}{\eta } = dS \tag {1} \end {align*}

The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial \theta } + \eta \frac {\partial }{\partial r}\right ) S(\theta ,r) = 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 = \theta \end {align*}

\(S\) is found from \begin {align*} S &= \int { \frac {1}{\eta }} dy\\ &= \int { \frac {1}{\frac {1}{\cos \left (\theta \right )^{2}}}} dy \end {align*}

Which results in \begin {align*} S&= r \cos \left (\theta \right )^{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_{\theta } + \omega (\theta ,r) S_{r} }{ R_{\theta } + \omega (\theta ,r) R_{r} }\tag {2} \end {align*}

Where in the above \(R_{\theta },R_{r},S_{\theta },S_{r}\) are all partial derivatives and \(\omega (\theta ,r)\) is the right hand side of the original ode given by \begin {align*} \omega (\theta ,r) &= \frac {2+2 r \sin \left (\theta \right )}{\cos \left (\theta \right )} \end {align*}

Evaluating all the partial derivatives gives \begin {align*} R_{\theta } &= 1\\ R_{r} &= 0\\ S_{\theta } &= -\sin \left (2 \theta \right ) r\\ S_{r} &= \cos \left (\theta \right )^{2} \end {align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates. \begin {align*} \frac {dS}{dR} &= 2 \cos \left (\theta \right )\tag {2A} \end {align*}

We now need to express the RHS as function of \(R\) only. This is done by solving for \(\theta ,r\) in terms of \(R,S\) from the result obtained earlier and simplifying. This gives \begin {align*} \frac {dS}{dR} &= 2 \cos \left (R \right ) \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\). Integrating the above gives \begin {align*} S \left (R \right ) = 2 \sin \left (R \right )+c_{1}\tag {4} \end {align*}

To complete the solution, we just need to transform (4) back to \(\theta ,r\) coordinates. This results in \begin {align*} \cos \left (\theta \right )^{2} r = 2 \sin \left (\theta \right )+c_{1} \end {align*}

Which simplifies to \begin {align*} \cos \left (\theta \right )^{2} r = 2 \sin \left (\theta \right )+c_{1} \end {align*}

Which gives \begin {align*} r = \frac {2 \sin \left (\theta \right )+c_{1}}{\cos \left (\theta \right )^{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 \(\theta ,r\) coordinates

Canonical coordinates transformation

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

\( \frac {dr}{d\theta } = \frac {2+2 r \sin \left (\theta \right )}{\cos \left (\theta \right )}\)

\( \frac {d S}{d R} = 2 \cos \left (R \right )\)

\(\!\begin {aligned} R&= \theta \\ S&= r \cos \left (\theta \right )^{2} \end {aligned} \)

Summary

The solution(s) found are the following \begin{align*} \tag{1} r &= \frac {2 \sin \left (\theta \right )+c_{1}}{\cos \left (\theta \right )^{2}} \\ \end{align*}

Figure 274: Slope field plot

Verification of solutions

\[ r = \frac {2 \sin \left (\theta \right )+c_{1}}{\cos \left (\theta \right )^{2}} \] Verified OK.

6.16.3 Solving as exact ode

Entering Exact first order ODE solver. (Form one type)

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(\theta ,r) \mathop {\mathrm {d}\theta }+ N(\theta ,r) \mathop {\mathrm {d}r}=0 \tag {1A} \] Therefore \begin {align*} \left (\cos \left (\theta \right )\right )\mathop {\mathrm {d}r} &= \left (2+2 r \sin \left (\theta \right )\right )\mathop {\mathrm {d}\theta }\\ \left (-2 r \sin \left (\theta \right )-2\right )\mathop {\mathrm {d}\theta } + \left (\cos \left (\theta \right )\right )\mathop {\mathrm {d}r} &= 0 \tag {2A} \end {align*}

Comparing (1A) and (2A) shows that \begin {align*} M(\theta ,r) &= -2 r \sin \left (\theta \right )-2\\ N(\theta ,r) &= \cos \left (\theta \right ) \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 r} = \frac {\partial N}{\partial \theta } \] Using result found above gives \begin {align*} \frac {\partial M}{\partial r} &= \frac {\partial }{\partial r} \left (-2 r \sin \left (\theta \right )-2\right )\\ &= -2 \sin \left (\theta \right ) \end {align*}

And \begin {align*} \frac {\partial N}{\partial \theta } &= \frac {\partial }{\partial \theta } \left (\cos \left (\theta \right )\right )\\ &= -\sin \left (\theta \right ) \end {align*}

Since \(\frac {\partial M}{\partial r} \neq \frac {\partial N}{\partial \theta }\), then the ODE is not exact. Since the ODE is not exact, we will try to find an integrating factor to make it exact. Let \begin {align*} A &= \frac {1}{N} \left (\frac {\partial M}{\partial r} - \frac {\partial N}{\partial \theta } \right ) \\ &=\sec \left (\theta \right )\left ( \left ( -2 \sin \left (\theta \right )\right ) - \left (-\sin \left (\theta \right ) \right ) \right ) \\ &=-\tan \left (\theta \right ) \end {align*}

Since \(A\) does not depend on \(r\), then it can be used to find an integrating factor. The integrating factor \(\mu \) is \begin {align*} \mu &= e^{ \int A \mathop {\mathrm {d}\theta } } \\ &= e^{\int -\tan \left (\theta \right )\mathop {\mathrm {d}\theta } } \end {align*}

The result of integrating gives \begin {align*} \mu &= e^{\ln \left (\cos \left (\theta \right )\right ) } \\ &= \cos \left (\theta \right ) \end {align*}

\(M\) and \(N\) are multiplied by this integrating factor, giving new \(M\) and new \(N\) which are called \(\overline {M}\) and \(\overline {N}\) for now so not to confuse them with the original \(M\) and \(N\). \begin {align*} \overline {M} &=\mu M \\ &= \cos \left (\theta \right )\left (-2 r \sin \left (\theta \right )-2\right ) \\ &= \left (-2 r \sin \left (\theta \right )-2\right ) \cos \left (\theta \right ) \end {align*}

And \begin {align*} \overline {N} &=\mu N \\ &= \cos \left (\theta \right )\left (\cos \left (\theta \right )\right ) \\ &= \cos \left (\theta \right )^{2} \end {align*}

Now a modified ODE is ontained from the original ODE, which is exact and can be solved. The modified ODE is \begin {align*} \overline {M} + \overline {N} \frac { \mathop {\mathrm {d}r}}{\mathop {\mathrm {d}\theta }} &= 0 \\ \left (\left (-2 r \sin \left (\theta \right )-2\right ) \cos \left (\theta \right )\right ) + \left (\cos \left (\theta \right )^{2}\right ) \frac { \mathop {\mathrm {d}r}}{\mathop {\mathrm {d}\theta }} &= 0 \end {align*}

The following equations are now set up to solve for the function \(\phi \left (\theta ,r\right )\) \begin {align*} \frac {\partial \phi }{\partial \theta } &= \overline {M}\tag {1} \\ \frac {\partial \phi }{\partial r } &= \overline {N}\tag {2} \end {align*}

Integrating (1) w.r.t. \(\theta \) gives \begin{align*} \int \frac {\partial \phi }{\partial \theta } \mathop {\mathrm {d}\theta } &= \int \overline {M}\mathop {\mathrm {d}\theta } \\ \int \frac {\partial \phi }{\partial \theta } \mathop {\mathrm {d}\theta } &= \int \left (-2 r \sin \left (\theta \right )-2\right ) \cos \left (\theta \right )\mathop {\mathrm {d}\theta } \\ \tag{3} \phi &= -\sin \left (\theta \right ) \left (r \sin \left (\theta \right )+2\right )+ f(r) \\ \end{align*} Where \(f(r)\) is used for the constant of integration since \(\phi \) is a function of both \(\theta \) and \(r\). Taking derivative of equation (3) w.r.t \(r\) gives \begin{equation} \tag{4} \frac {\partial \phi }{\partial r} = -\sin \left (\theta \right )^{2}+f'(r) \end{equation} But equation (2) says that \(\frac {\partial \phi }{\partial r} = \cos \left (\theta \right )^{2}\). Therefore equation (4) becomes \begin{equation} \tag{5} \cos \left (\theta \right )^{2} = -\sin \left (\theta \right )^{2}+f'(r) \end{equation} Solving equation (5) for \( f'(r)\) gives \begin{align*} f'(r) &= \sin \left (\theta \right )^{2}+\cos \left (\theta \right )^{2} \\ &= 1\\ \end{align*} Integrating the above w.r.t \(r\) results in \begin{align*} \int f'(r) \mathop {\mathrm {d}r} &= \int \left ( 1\right ) \mathop {\mathrm {d}r} \\ f(r) &= r+ c_{1} \\ \end{align*} Where \(c_{1}\) is constant of integration. Substituting result found above for \(f(r)\) into equation (3) gives \(\phi \) \[ \phi = -\sin \left (\theta \right ) \left (r \sin \left (\theta \right )+2\right )+r+ 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 new constant \(c_{1}\) gives the solution as \[ c_{1} = -\sin \left (\theta \right ) \left (r \sin \left (\theta \right )+2\right )+r \] The solution becomes\[ r = -\frac {2 \sin \left (\theta \right )+c_{1}}{\sin \left (\theta \right )^{2}-1} \]

Summary

The solution(s) found are the following \begin{align*} \tag{1} r &= -\frac {2 \sin \left (\theta \right )+c_{1}}{\sin \left (\theta \right )^{2}-1} \\ \end{align*}

Figure 275: Slope field plot

Verification of solutions

\[ r = -\frac {2 \sin \left (\theta \right )+c_{1}}{\sin \left (\theta \right )^{2}-1} \] Verified OK.

6.16.4 Maple step by step solution

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \cos \left (\theta \right ) r^{\prime }-2 r \sin \left (\theta \right )=2 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & r^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & r^{\prime }=\frac {2+2 r \sin \left (\theta \right )}{\cos \left (\theta \right )} \\ \bullet & {} & \textrm {Collect w.r.t.}\hspace {3pt} r\hspace {3pt}\textrm {and simplify}\hspace {3pt} \\ {} & {} & r^{\prime }=\frac {2 \sin \left (\theta \right ) r}{\cos \left (\theta \right )}+\frac {2}{\cos \left (\theta \right )} \\ \bullet & {} & \textrm {Group terms with}\hspace {3pt} r\hspace {3pt}\textrm {on the lhs of the ODE and the rest on the rhs of the ODE}\hspace {3pt} \\ {} & {} & r^{\prime }-\frac {2 \sin \left (\theta \right ) r}{\cos \left (\theta \right )}=\frac {2}{\cos \left (\theta \right )} \\ \bullet & {} & \textrm {The ODE is linear; multiply by an integrating factor}\hspace {3pt} \mu \left (\theta \right ) \\ {} & {} & \mu \left (\theta \right ) \left (r^{\prime }-\frac {2 \sin \left (\theta \right ) r}{\cos \left (\theta \right )}\right )=\frac {2 \mu \left (\theta \right )}{\cos \left (\theta \right )} \\ \bullet & {} & \textrm {Assume the lhs of the ODE is the total derivative}\hspace {3pt} \frac {d}{d \theta }\left (r \mu \left (\theta \right )\right ) \\ {} & {} & \mu \left (\theta \right ) \left (r^{\prime }-\frac {2 \sin \left (\theta \right ) r}{\cos \left (\theta \right )}\right )=r^{\prime } \mu \left (\theta \right )+r \mu ^{\prime }\left (\theta \right ) \\ \bullet & {} & \textrm {Isolate}\hspace {3pt} \mu ^{\prime }\left (\theta \right ) \\ {} & {} & \mu ^{\prime }\left (\theta \right )=-\frac {2 \mu \left (\theta \right ) \sin \left (\theta \right )}{\cos \left (\theta \right )} \\ \bullet & {} & \textrm {Solve to find the integrating factor}\hspace {3pt} \\ {} & {} & \mu \left (\theta \right )=\cos \left (\theta \right )^{2} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} \theta \\ {} & {} & \int \left (\frac {d}{d \theta }\left (r \mu \left (\theta \right )\right )\right )d \theta =\int \frac {2 \mu \left (\theta \right )}{\cos \left (\theta \right )}d \theta +c_{1} \\ \bullet & {} & \textrm {Evaluate the integral on the lhs}\hspace {3pt} \\ {} & {} & r \mu \left (\theta \right )=\int \frac {2 \mu \left (\theta \right )}{\cos \left (\theta \right )}d \theta +c_{1} \\ \bullet & {} & \textrm {Solve for}\hspace {3pt} r \\ {} & {} & r=\frac {\int \frac {2 \mu \left (\theta \right )}{\cos \left (\theta \right )}d \theta +c_{1}}{\mu \left (\theta \right )} \\ \bullet & {} & \textrm {Substitute}\hspace {3pt} \mu \left (\theta \right )=\cos \left (\theta \right )^{2} \\ {} & {} & r=\frac {\int 2 \cos \left (\theta \right )d \theta +c_{1}}{\cos \left (\theta \right )^{2}} \\ \bullet & {} & \textrm {Evaluate the integrals on the rhs}\hspace {3pt} \\ {} & {} & r=\frac {2 \sin \left (\theta \right )+c_{1}}{\cos \left (\theta \right )^{2}} \\ \bullet & {} & \textrm {Simplify}\hspace {3pt} \\ {} & {} & r=\sec \left (\theta \right )^{2} \left (2 \sin \left (\theta \right )+c_{1} \right ) \end {array} \]

Maple trace

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

Solution by Maple

Time used: 0.0 (sec). Leaf size: 15

dsolve(cos(theta)*diff(r(theta),theta)=2+2*r(theta)*sin(theta),r(theta), singsol=all)
 

\[ r \left (\theta \right ) = \sec \left (\theta \right )^{2} \left (2 \sin \left (\theta \right )+c_{1} \right ) \]

Solution by Mathematica

Time used: 0.052 (sec). Leaf size: 17

DSolve[Cos[\[Theta]]*r'[\[Theta]]==2+2*r[\[Theta]]*Sin[\[Theta]],r[\[Theta]],\[Theta],IncludeSingularSolutions -> True]
 

\[ r(\theta )\to \sec ^2(\theta ) (2 \sin (\theta )+c_1) \]