23.1.112 problem 115

Internal problem ID [4719]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 1. THE DIFFERENTIAL EQUATION IS OF FIRST ORDER AND OF FIRST DEGREE, page 223
Problem number : 115
Date solved : Sunday, October 12, 2025 at 01:18:00 AM
CAS classification : [`y=_G(x,y')`]

\begin{align*} y^{\prime }+x \left (\sin \left (2 y\right )-x^{2} \cos \left (y\right )^{2}\right )&=0 \end{align*}
Maple. Time used: 0.011 (sec). Leaf size: 21
ode:=diff(y(x),x)+x*(sin(2*y(x))-x^2*cos(y(x))^2) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\frac {{\mathrm e}^{-x^{2}} c_1}{2}+\frac {x^{2}}{2}-\frac {1}{2}\right ) \]
Mathematica. Time used: 16.622 (sec). Leaf size: 105
ode=D[y[x],x]+x*(Sin[2*y[x]]-x^2*Cos[y[x]]^2)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \arctan \left (\frac {1}{2} \left (x^2-8 c_1 e^{-x^2}-1\right )\right )\\ y(x)&\to -\arctan \left (-\frac {x^2}{2}+4 c_1 e^{-x^2}+\frac {1}{2}\right )\\ y(x)&\to -\frac {1}{2} \pi e^{x^2} \sqrt {e^{-2 x^2}}\\ y(x)&\to \frac {1}{2} \pi e^{x^2} \sqrt {e^{-2 x^2}} \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*(-x**2*cos(y(x))**2 + sin(2*y(x))) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*(x**2*cos(y(x))**2 - sin(2*y(x))) + Derivative(y(x), x) cannot be solved by the factorable group method