30.3.25 problem 26

Internal problem ID [7481]
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 : 26
Date solved : Tuesday, September 30, 2025 at 04:38:17 PM
CAS classification : [_exact, [_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

With initial conditions

\begin{align*} y \left (0\right )&=1 \\ \end{align*}
Maple. Time used: 0.252 (sec). Leaf size: 15
ode:=tan(y(x))-2+(x*sec(y(x))^2+1/y(x))*diff(y(x),x) = 0; 
ic:=[y(0) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \operatorname {RootOf}\left (x \tan \left (\textit {\_Z} \right )+\ln \left (\textit {\_Z} \right )-2 x \right ) \]
Mathematica. Time used: 0.295 (sec). Leaf size: 38
ode=( Tan[y[x]]-2  )+( x*Sec[y[x]]^2+1/y[x] )*D[y[x],x]==0; 
ic={y[0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ \text {Solve}\left [x=\log (y(x)) \exp \left (2 \left (\frac {1}{2} \log (\cos (y(x)))-\frac {1}{2} \log (2 \cos (y(x))-\sin (y(x)))\right )\right ),y(x)\right ] \]
Sympy. Time used: 9.133 (sec). Leaf size: 14
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x*sec(y(x))**2 + 1/y(x))*Derivative(y(x), x) + tan(y(x)) - 2,0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ x \left (\tan {\left (y{\left (x \right )} \right )} - 2\right ) + \log {\left (y{\left (x \right )} \right )} = 0 \]