28.1.26 problem 26

Internal problem ID [4332]
Book : Differential equations for engineers by Wei-Chau XIE, Cambridge Press 2010
Section : Chapter 2. First-Order and Simple Higher-Order Differential Equations. Page 78
Problem number : 26
Date solved : Tuesday, March 04, 2025 at 06:24:49 PM
CAS classification : [_exact, [_Abel, `2nd type`, `class B`]]

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

Maple. Time used: 0.027 (sec). Leaf size: 83
ode:=3+y(x)+2*y(x)^2*sin(x)^2+(x+2*x*y(x)-y(x)*sin(2*x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y \left (x \right ) &= \frac {x +\sqrt {\left (2 c_{1} +6 x \right ) \sin \left (2 x \right )-11 x^{2}-4 c_{1} x}}{\sin \left (2 x \right )-2 x} \\ y \left (x \right ) &= \frac {-\sqrt {\left (2 c_{1} +6 x \right ) \sin \left (2 x \right )-11 x^{2}-4 c_{1} x}+x}{\sin \left (2 x \right )-2 x} \\ \end{align*}
Mathematica. Time used: 1.281 (sec). Leaf size: 97
ode=(3+y[x]+2*y[x]^2*Sin[x]^2)+(x+2*x*y[x]-y[x]*Sin[2*x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {x-i \sqrt {x (11 x+2 c_1)-(6 x+c_1) \sin (2 x)}}{\sin (2 x)-2 x} \\ y(x)\to \frac {x+i \sqrt {x (11 x+2 c_1)-(6 x+c_1) \sin (2 x)}}{\sin (2 x)-2 x} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((2*x*y(x) + x - y(x)*sin(2*x))*Derivative(y(x), x) + 2*y(x)**2*sin(x)**2 + y(x) + 3,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out