30.3.20 problem 21

Internal problem ID [7476]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.4, Exact equations. Exercises. page 64
Problem number : 21
Date solved : Tuesday, September 30, 2025 at 04:38:03 PM
CAS classification : [_exact]

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

With initial conditions

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