30.6.35 problem 36

Internal problem ID [7570]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Review problems. page 79
Problem number : 36
Date solved : Tuesday, September 30, 2025 at 04:53:21 PM
CAS classification : [_exact]

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

With initial conditions

\begin{align*} y \left (1\right )&=0 \\ \end{align*}
Maple. Time used: 0.251 (sec). Leaf size: 32
ode:=2*cos(y(x)+2*x)-x^2+(cos(y(x)+2*x)+exp(y(x)))*diff(y(x),x) = 0; 
ic:=[y(1) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = -2 x +\operatorname {RootOf}\left (\textit {\_Z} -2 x +\ln \left (3\right )-\ln \left (x^{3}-3 \sin \left (\textit {\_Z} \right )+3 \sin \left (2\right )+2\right )\right ) \]
Mathematica. Time used: 0.522 (sec). Leaf size: 42
ode=(2*Cos[2*x+y[x]]-x^2 )+( Cos[2*x+y[x]] +Exp[y[x]] )*D[y[x],x]==0; 
ic={y[1]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [-\frac {x^3}{3}+e^{y(x)}+\sin (2 x) \cos (y(x))+\cos (2 x) \sin (y(x))=\frac {1}{3} (2+3 \sin (2)),y(x)\right ] \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + (exp(y(x)) + cos(2*x + y(x)))*Derivative(y(x), x) + 2*cos(2*x + y(x)),0) 
ics = {y(1): 0} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out