30.1.12 problem 12

Internal problem ID [7402]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.2, Separable Equations. Exercises. page 46
Problem number : 12
Date solved : Tuesday, September 30, 2025 at 04:30:38 PM
CAS classification : [_separable]

\begin{align*} y^{\prime }&=\frac {\sec \left (y\right )^{2}}{x^{2}+1} \end{align*}
Maple. Time used: 0.145 (sec). Leaf size: 81
ode:=diff(y(x),x) = sec(y(x))^2/(x^2+1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\arcsin \left (\operatorname {RootOf}\left (\textit {\_Z} \,x^{4}+2 \textit {\_Z} \,x^{2}+\textit {\_Z} -x^{4} \sin \left (4 c_1 -\textit {\_Z} \right )+4 x^{3} \cos \left (4 c_1 -\textit {\_Z} \right )+6 x^{2} \sin \left (4 c_1 -\textit {\_Z} \right )-4 x \cos \left (4 c_1 -\textit {\_Z} \right )-\sin \left (4 c_1 -\textit {\_Z} \right )\right )\right )}{2} \]
Mathematica. Time used: 0.349 (sec). Leaf size: 42
ode=D[y[x],x]==Sec[y[x]]^2/(1+x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \text {InverseFunction}\left [\int _1^{\text {$\#$1}}(\cos (2 K[1])+1)dK[1]\&\right ]\left [\int _1^x\frac {2}{K[2]^2+1}dK[2]+c_1\right ] \end{align*}
Sympy. Time used: 1.124 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 1/((x**2 + 1)*cos(y(x))**2),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \frac {y{\left (x \right )}}{2} + \frac {\sin {\left (y{\left (x \right )} \right )} \cos {\left (y{\left (x \right )} \right )}}{2} - \operatorname {atan}{\left (x \right )} = C_{1} \]