28.1.28 problem 28

Internal problem ID [4334]
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 : 28
Date solved : Sunday, March 30, 2025 at 03:05:36 AM
CAS classification : [`y=_G(x,y')`]

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

Maple. Time used: 0.014 (sec). Leaf size: 27
ode:=x^2-sin(y(x))^2+x*sin(2*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \arcsin \left (\sqrt {-x \left (c_1 +x \right )}\right ) \\ y &= -\arcsin \left (\sqrt {-x \left (c_1 +x \right )}\right ) \\ \end{align*}
Mathematica. Time used: 6.537 (sec). Leaf size: 39
ode=(x^2-Sin[y[x]]^2)+(x*Sin[2*y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\arcsin \left (\sqrt {-x (x+2 c_1)}\right ) \\ y(x)\to \arcsin \left (\sqrt {-x (x+2 c_1)}\right ) \\ \end{align*}
Sympy. Time used: 7.259 (sec). Leaf size: 105
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2 + x*sin(2*y(x))*Derivative(y(x), x) - sin(y(x))**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \operatorname {acos}{\left (- \frac {\sqrt {2} \sqrt {C_{1} x + 2 x^{2} + 2}}{2} \right )} + 2 \pi , \ y{\left (x \right )} = - \operatorname {acos}{\left (\frac {\sqrt {2} \sqrt {C_{1} x + 2 x^{2} + 2}}{2} \right )} + 2 \pi , \ y{\left (x \right )} = \operatorname {acos}{\left (- \frac {\sqrt {2} \sqrt {C_{1} x + 2 x^{2} + 2}}{2} \right )}, \ y{\left (x \right )} = \operatorname {acos}{\left (\frac {\sqrt {2} \sqrt {C_{1} x + 2 x^{2} + 2}}{2} \right )}\right ] \]