89.6.9 problem 9

Internal problem ID [24392]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 2. Equations of the first order and first degree. Miscellaneous Exercises at page 45
Problem number : 9
Date solved : Thursday, October 02, 2025 at 10:24:19 PM
CAS classification : [_linear]

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