4.2.3 problem 3

Internal problem ID [1131]
Book : Elementary differential equations and boundary value problems, 10th ed., Boyce and DiPrima
Section : Section 2.2. Page 48
Problem number : 3
Date solved : Tuesday, September 30, 2025 at 04:23:18 AM
CAS classification : [_separable]

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