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 [18495]
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 : Monday, March 31, 2025 at 05:37:38 PM
CAS classification : [_quadrature]

Solved using first_order_ode_quadrature

Time used: 0.123 (sec)

Solve

sec(θ)2=msk

Since the ode has the form s=f(θ), then we only need to integrate f(θ).

ds=sec(θ)2kmdθs=ktan(θ)m+c1

Summary of solutions found

s=ktan(θ)m+c1
Solved using first_order_ode_exact

Time used: 0.119 (sec)

Solve

sec(θ)2=msk

To solve an ode of the form

(A)M(x,y)+N(x,y)dydx=0

We assume there exists a function ϕ(x,y)=c where c is constant, that satisfies the ode. Taking derivative of ϕ w.r.t. x gives

ddxϕ(x,y)=0

Hence

(B)ϕx+ϕydydx=0

Comparing (A,B) shows that

ϕx=Mϕy=N

But since 2ϕxy=2ϕyx then for the above to be valid, we require that

My=Nx

If the above condition is satisfied, then the original ode is called exact. We still need to determine ϕ(x,y) but at least we know now that we can do that since the condition 2ϕxy=2ϕyx 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

(1A)M(θ,s)dθ+N(θ,s)ds=0

Therefore

(mk)ds=(sec(θ)2)dθ(2A)(sec(θ)2)dθ+(mk)ds=0

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

M(θ,s)=sec(θ)2N(θ,s)=mk

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied

Ms=Nθ

Using result found above gives

Ms=s(sec(θ)2)=0

And

Nθ=θ(mk)=0

Since Ms=Nθ, then the ODE is exact The following equations are now set up to solve for the function ϕ(θ,s)

(1)ϕθ=M(2)ϕs=N

Integrating (1) w.r.t. θ gives

ϕθdθ=Mdθϕθdθ=sec(θ)2dθ(3)ϕ=tan(θ)+f(s)

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

(4)ϕs=0+f(s)

But equation (2) says that ϕs=mk. Therefore equation (4) becomes

(5)mk=0+f(s)

Solving equation (5) for f(s) gives

f(s)=mk

Integrating the above w.r.t s gives

f(s)ds=(mk)dsf(s)=msk+c2

Where c2 is constant of integration. Substituting result found above for f(s) into equation (3) gives ϕ

ϕ=tan(θ)msk+c2

But since ϕ itself is a constant function, then let ϕ=c3 where c2 is new constant and combining c2 and c3 constants into the constant c2 gives the solution as

c2=tan(θ)msk

Solving for s gives

s=(c2+tan(θ))km

Summary of solutions found

s=(c2+tan(θ))km
Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=sec(theta)^2 = m/k*diff(s(theta),theta); 
dsolve(ode,s(theta), singsol=all);
 
s=ktan(θ)m+c1

Maple trace

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

Maple step by step

Let’s solvesec(θ)2=m(ddθs(θ))kHighest derivative means the order of the ODE is1ddθs(θ)Separate variablesddθs(θ)=sec(θ)2kmIntegrate both sides with respect toθ(ddθs(θ))dθ=sec(θ)2kmdθ+C1Evaluate integrals(θ)=ktan(θ)m+C1
Mathematica. Time used: 0.01 (sec). Leaf size: 15
ode=Sec[theta]^2==m/k*D[s[theta],theta]; 
ic={}; 
DSolve[{ode,ic},s[theta],theta,IncludeSingularSolutions->True]
 
s(θ)ktan(θ)m+c1
Sympy. Time used: 0.175 (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(θ)=C1+ksin(θ)mcos(θ)