35.8.23 problem 23

Internal problem ID [6230]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 13. Miscellaneous problems. page 466
Problem number : 23
Date solved : Sunday, March 30, 2025 at 10:44:03 AM
CAS classification : [_linear]

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

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