65.5.1 problem 10.1 (i)

Internal problem ID [13669]
Book : AN INTRODUCTION TO ORDINARY DIFFERENTIAL EQUATIONS by JAMES C. ROBINSON. Cambridge University Press 2004
Section : Chapter 10, Two tricks for nonlinear equations. Exercises page 97
Problem number : 10.1 (i)
Date solved : Monday, March 31, 2025 at 08:07:17 AM
CAS classification : [_exact, [_1st_order, `_with_symmetry_[F(x),G(x)]`], [_Abel, `2nd type`, `class A`]]

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

Maple. Time used: 0.006 (sec). Leaf size: 49
ode:=2*x*y(x)-sec(x)^2+(x^2+2*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= -\frac {x^{2}}{2}-\frac {\sqrt {x^{4}+4 \tan \left (x \right )-4 c_1}}{2} \\ y &= -\frac {x^{2}}{2}+\frac {\sqrt {x^{4}+4 \tan \left (x \right )-4 c_1}}{2} \\ \end{align*}
Mathematica. Time used: 22.561 (sec). Leaf size: 90
ode=(2*x*y[x]- Sec[x]^2)+(x^2+2*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {1}{2} \left (-x^2-\sqrt {\sec ^2(x)} \sqrt {\cos ^2(x) \left (x^4+4 \tan (x)+4 c_1\right )}\right ) \\ y(x)\to \frac {1}{2} \left (-x^2+\sqrt {\sec ^2(x)} \sqrt {\cos ^2(x) \left (x^4+4 \tan (x)+4 c_1\right )}\right ) \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(2*x*y(x) + (x**2 + 2*y(x))*Derivative(y(x), x) - 1/cos(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out