15.6.16 problem 16

Internal problem ID [2973]
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
Date solved : Sunday, March 30, 2025 at 01:02:48 AM
CAS classification : [_linear]

\begin{align*} \cos \left (\theta \right ) r^{\prime }&=2+2 r \sin \left (\theta \right ) \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 15
ode:=cos(theta)*diff(r(theta),theta) = 2+2*r(theta)*sin(theta); 
dsolve(ode,r(theta), singsol=all);
 
\[ r = \left (2 \sin \left (\theta \right )+c_1 \right ) \sec \left (\theta \right )^{2} \]
Mathematica. Time used: 0.048 (sec). Leaf size: 17
ode=Cos[\[Theta]]*D[ r[\[Theta]], \[Theta] ]==2+2*r[\[Theta]]*Sin[\[Theta]]; 
ic={}; 
DSolve[{ode,ic},r[\[Theta]],\[Theta],IncludeSingularSolutions->True]
 
\[ r(\theta )\to \sec ^2(\theta ) (2 \sin (\theta )+c_1) \]
Sympy. Time used: 0.945 (sec). Leaf size: 14
from sympy import * 
theta = symbols("theta") 
r = Function("r") 
ode = Eq(-2*r(theta)*sin(theta) + cos(theta)*Derivative(r(theta), theta) - 2,0) 
ics = {} 
dsolve(ode,func=r(theta),ics=ics)
 
\[ r{\left (\theta \right )} = \frac {C_{1} + 2 \sin {\left (\theta \right )}}{\cos ^{2}{\left (\theta \right )}} \]