48.4.8 problem Problem 3.11

Internal problem ID [7550]
Book : THEORY OF DIFFERENTIAL EQUATIONS IN ENGINEERING AND MECHANICS. K.T. CHAU, CRC Press. Boca Raton, FL. 2018
Section : Chapter 3. Ordinary Differential Equations. Section 3.6 Summary and Problems. Page 218
Problem number : Problem 3.11
Date solved : Sunday, March 30, 2025 at 12:14:39 PM
CAS classification : [_Bernoulli]

\begin{align*} \phi ^{\prime }-\frac {\phi ^{2}}{2}-\phi \cot \left (\theta \right )&=0 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 16
ode:=diff(phi(theta),theta)-1/2*phi(theta)^2-phi(theta)*cot(theta) = 0; 
dsolve(ode,phi(theta), singsol=all);
 
\[ \phi = \frac {2 \sin \left (\theta \right )}{\cos \left (\theta \right )+2 c_1} \]
Mathematica. Time used: 0.279 (sec). Leaf size: 23
ode=D[ \[Phi][\[Theta]] ,  \[Theta] ]-1/2*\[Phi][\[Theta]]^2-\[Phi][\[Theta]]*Cot[\[Theta]]==0; 
ic={}; 
DSolve[{ode,ic},\[Phi][\[Theta]],\[Theta],IncludeSingularSolutions->True]
 
\begin{align*} \phi (\theta )\to \frac {2 \sin (\theta )}{\cos (\theta )+2 c_1} \\ \phi (\theta )\to 0 \\ \end{align*}
Sympy. Time used: 0.275 (sec). Leaf size: 12
from sympy import * 
theta = symbols("theta") 
phi = Function("phi") 
ode = Eq(-phi(theta)**2/2 - phi(theta)/tan(theta) + Derivative(phi(theta), theta),0) 
ics = {} 
dsolve(ode,func=phi(theta),ics=ics)
 
\[ \phi {\left (\theta \right )} = \frac {2 \sin {\left (\theta \right )}}{C_{1} + \cos {\left (\theta \right )}} \]