2.6.2 Problem 2 (eq 39)

Solved using first_order_ode_quadrature
Solved using first_order_ode_exact
Maple
Mathematica
Sympy

Internal problem ID [19737]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 33. Problems at page 91
Problem number : 2 (eq 39)
Date solved : Friday, November 28, 2025 at 06:42:25 PM
CAS classification : [_quadrature]

Solved using first_order_ode_quadrature

Time used: 0.243 (sec)

Solve

\begin{align*} \sec \left (\theta \right )^{2}&=\frac {m s^{\prime }}{k} \\ \end{align*}
Since the ode has the form \(s^{\prime }=f(\theta )\), then we only need to integrate \(f(\theta )\).
\begin{align*} \int {ds} &= \int {\frac {\sec \left (\theta \right )^{2} k}{m}\, d\theta }\\ s &= \frac {k \tan \left (\theta \right )}{m} + c_1 \end{align*}

Summary of solutions found

\begin{align*} s &= \frac {k \tan \left (\theta \right )}{m}+c_1 \\ \end{align*}
Solved using first_order_ode_exact

Time used: 0.153 (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(\theta ,s) \mathop {\mathrm {d}\theta }+ N(\theta ,s) \mathop {\mathrm {d}s}=0 \tag {1A} \]
Therefore
\begin{align*} \left (-\frac {m}{k}\right )\mathop {\mathrm {d}s} &= \left (-\sec \left (\theta \right )^{2}\right )\mathop {\mathrm {d}\theta }\\ \left (\sec \left (\theta \right )^{2}\right )\mathop {\mathrm {d}\theta } + \left (-\frac {m}{k}\right )\mathop {\mathrm {d}s} &= 0 \tag {2A} \end{align*}

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

\begin{align*} M(\theta ,s) &= \sec \left (\theta \right )^{2}\\ N(\theta ,s) &= -\frac {m}{k} \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 s} = \frac {\partial N}{\partial \theta } \]
Using result found above gives
\begin{align*} \frac {\partial M}{\partial s} &= \frac {\partial }{\partial s} \left (\sec \left (\theta \right )^{2}\right )\\ &= 0 \end{align*}

And

\begin{align*} \frac {\partial N}{\partial \theta } &= \frac {\partial }{\partial \theta } \left (-\frac {m}{k}\right )\\ &= 0 \end{align*}

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

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

Summary of solutions found

\begin{align*} s &= \frac {\left (-c_1 +\tan \left (\theta \right )\right ) k}{m} \\ \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 13
ode:=sec(theta)^2 = m/k*diff(s(theta),theta); 
dsolve(ode,s(theta), singsol=all);
 
\[ s = \frac {k \tan \left (\theta \right )}{m}+c_1 \]

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
<- quadrature successful
 

Maple step by step

\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & \sec \left (\theta \right )^{2}=\frac {m \left (\frac {d}{d \theta }s \left (\theta \right )\right )}{k} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d \theta }s \left (\theta \right ) \\ \bullet & {} & \textrm {Separate variables}\hspace {3pt} \\ {} & {} & \frac {d}{d \theta }s \left (\theta \right )=\frac {\sec \left (\theta \right )^{2} k}{m} \\ \bullet & {} & \textrm {Integrate both sides with respect to}\hspace {3pt} \theta \\ {} & {} & \int \left (\frac {d}{d \theta }s \left (\theta \right )\right )d \theta =\int \frac {\sec \left (\theta \right )^{2} k}{m}d \theta +\mathit {C1} \\ \bullet & {} & \textrm {Evaluate integral}\hspace {3pt} \\ {} & {} & s \left (\theta \right )=\frac {k \tan \left (\theta \right )}{m}+\mathit {C1} \end {array} \]
Mathematica. Time used: 0.007 (sec). Leaf size: 15
ode=Sec[theta]^2==m/k*D[s[theta],theta]; 
ic={}; 
DSolve[{ode,ic},s[theta],theta,IncludeSingularSolutions->True]
 
\begin{align*} s(\theta )&\to \frac {k \tan (\theta )}{m}+c_1 \end{align*}
Sympy. Time used: 0.096 (sec). Leaf size: 14
from sympy import * 
theta = symbols("theta") 
k = symbols("k") 
m = symbols("m") 
s = Function("s") 
ode = Eq(cos(theta)**(-2) - m*Derivative(s(theta), theta)/k,0) 
ics = {} 
dsolve(ode,func=s(theta),ics=ics)
 
\[ s{\left (\theta \right )} = C_{1} + \frac {k \sin {\left (\theta \right )}}{m \cos {\left (\theta \right )}} \]