18.1.6 problem Problem 14.3 (c)

Internal problem ID [3462]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.3 (c)
Date solved : Tuesday, March 04, 2025 at 04:40:13 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x)*G(y),0]`], [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.008 (sec). Leaf size: 14
ode:=(cos(x)^2+y(x)*sin(2*x))*diff(y(x),x)+y(x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ c_{1} +y \left (x \right )^{2} \tan \left (x \right )+y \left (x \right ) = 0 \]
Mathematica. Time used: 22.716 (sec). Leaf size: 170
ode=(Cos[x]^2+y[x]*Sin[2*x])*D[y[x],x]+y[x]^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\frac {\cot (x)}{2}-\frac {\csc (2 x) \sqrt {e^{-\text {arctanh}(\cos (2 x))} \left (4 c_1 \sin (2 x) e^{\text {arctanh}(\cos (2 x))}+\csc (2 x)+(\cos (2 x)+2) \cot (2 x)\right )}}{2 \sqrt {\csc (2 x) e^{-\text {arctanh}(\cos (2 x))}}} \\ y(x)\to -\frac {\cot (x)}{2}+\frac {\csc (2 x) \sqrt {e^{-\text {arctanh}(\cos (2 x))} \left (4 c_1 \sin (2 x) e^{\text {arctanh}(\cos (2 x))}+\csc (2 x)+(\cos (2 x)+2) \cot (2 x)\right )}}{2 \sqrt {\csc (2 x) e^{-\text {arctanh}(\cos (2 x))}}} \\ y(x)\to 0 \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((y(x)*sin(2*x) + cos(x)**2)*Derivative(y(x), x) + y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out