75.4.13 problem 58

Internal problem ID [16636]
Book : A book of problems in ordinary differential equations. M.L. KRASNOV, A.L. KISELYOV, G.I. MARKARENKO. MIR, MOSCOW. 1983
Section : Section 4. Equations with variables separable and equations reducible to them. Exercises page 38
Problem number : 58
Date solved : Thursday, March 13, 2025 at 08:28:18 AM
CAS classification : [_separable]

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

Maple. Time used: 0.721 (sec). Leaf size: 21
ode:=y(x)^2*sin(x)+cos(x)^2*ln(y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {\operatorname {LambertW}\left (-\left (\sec \left (x \right )+c_{1} \right ) {\mathrm e}^{-1}\right )}{\sec \left (x \right )+c_{1}} \]
Mathematica. Time used: 60.155 (sec). Leaf size: 29
ode=y[x]^2*Sin[x]+Cos[x]^2*Log[y[x]]*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {\cos (x) W\left (\frac {-\sec (x)+c_1}{e}\right )}{-1+c_1 \cos (x)} \]
Sympy. Time used: 1.783 (sec). Leaf size: 58
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)**2*sin(x) + log(y(x))*cos(x)**2*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\left (e^{2 i x} + 1\right ) W\left (\frac {C_{1} e^{2 i x} + C_{1} - 2 e^{i x}}{e \left (e^{2 i x} + 1\right )}\right )}{C_{1} e^{2 i x} + C_{1} - 2 e^{i x}} \]