30.2.9 problem 9

Internal problem ID [7437]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 9
Date solved : Tuesday, September 30, 2025 at 04:35:20 PM
CAS classification : [_linear]

\begin{align*} r^{\prime }+r \tan \left (\theta \right )&=\sec \left (\theta \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 11
ode:=diff(r(theta),theta)+r(theta)*tan(theta) = sec(theta); 
dsolve(ode,r(theta), singsol=all);
 
\[ r = \cos \left (\theta \right ) c_1 +\sin \left (\theta \right ) \]
Mathematica. Time used: 0.026 (sec). Leaf size: 13
ode=D[ r[\[Theta]], \[Theta] ]+r[\[Theta]]*Tan[\[Theta]]==Sec[\[Theta]]; 
ic={}; 
DSolve[{ode,ic},r[\[Theta]],\[Theta],IncludeSingularSolutions->True]
 
\begin{align*} r(\theta )&\to \sin (\theta )+c_1 \cos (\theta ) \end{align*}
Sympy. Time used: 0.400 (sec). Leaf size: 10
from sympy import * 
theta = symbols("theta") 
r = Function("r") 
ode = Eq(r(theta)*tan(theta) + Derivative(r(theta), theta) - 1/cos(theta),0) 
ics = {} 
dsolve(ode,func=r(theta),ics=ics)
 
\[ r{\left (\theta \right )} = C_{1} \cos {\left (\theta \right )} + \sin {\left (\theta \right )} \]