36.2.9 problem 9

Internal problem ID [6302]
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 : Sunday, March 30, 2025 at 10:50:05 AM
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.042 (sec). Leaf size: 13
ode=D[ r[\[Theta]], \[Theta] ]+r[\[Theta]]*Tan[\[Theta]]==Sec[\[Theta]]; 
ic={}; 
DSolve[{ode,ic},r[\[Theta]],\[Theta],IncludeSingularSolutions->True]
 
\[ r(\theta )\to \sin (\theta )+c_1 \cos (\theta ) \]
Sympy. Time used: 0.643 (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 )} \]