81.3.9 problem 9

Internal problem ID [18548]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter III. Ordinary differential equations of the first order and first degree. Exercises at page 33
Problem number : 9
Date solved : Thursday, March 13, 2025 at 12:12:32 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }+\sin \left (x \right ) y&=y^{2} \sin \left (x \right ) \end{align*}

Maple. Time used: 0.003 (sec). Leaf size: 15
ode:=diff(y(x),x)+sin(x)*y(x) = y(x)^2*sin(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {1}{{\mathrm e}^{-\cos \left (x \right )} c_{1} +1} \]
Mathematica. Time used: 0.344 (sec). Leaf size: 31
ode=D[y[x],x]+Sin[x]*y[x]==y[x]^2*Sin[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {e^{\cos (x)}}{e^{\cos (x)}+e^{c_1}} \\ y(x)\to 0 \\ y(x)\to 1 \\ \end{align*}
Sympy. Time used: 0.569 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**2*sin(x) + y(x)*sin(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1}{C_{1} e^{- \cos {\left (x \right )}} + 1} \]