12.2.38 problem 48(a)

Internal problem ID [1574]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Linear first order. Section 2.1 Page 41
Problem number : 48(a)
Date solved : Saturday, March 29, 2025 at 10:59:55 PM
CAS classification : [_quadrature]

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

Maple. Time used: 0.005 (sec). Leaf size: 14
ode:=sec(y(x))^2*diff(y(x),x)-3*tan(y(x)) = -1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\frac {{\mathrm e}^{3 x} c_1}{3}+\frac {1}{3}\right ) \]
Mathematica. Time used: 60.185 (sec). Leaf size: 177
ode=Sec[y[x]]^2*D[y[x],x]-3*Tan[y[x]]== -1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\arccos \left (-\frac {3 e^{6 c_1}}{\sqrt {e^{6 x}-2 e^{3 x+6 c_1}+10 e^{12 c_1}}}\right ) \\ y(x)\to \arccos \left (-\frac {3 e^{6 c_1}}{\sqrt {e^{6 x}-2 e^{3 x+6 c_1}+10 e^{12 c_1}}}\right ) \\ y(x)\to -\arccos \left (\frac {3 e^{6 c_1}}{\sqrt {e^{6 x}-2 e^{3 x+6 c_1}+10 e^{12 c_1}}}\right ) \\ y(x)\to \arccos \left (\frac {3 e^{6 c_1}}{\sqrt {e^{6 x}-2 e^{3 x+6 c_1}+10 e^{12 c_1}}}\right ) \\ \end{align*}
Sympy. Time used: 1.706 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*tan(y(x)) + 1 + Derivative(y(x), x)/cos(y(x))**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ - \int \limits ^{y{\left (x \right )}} \frac {1}{\left (3 \tan {\left (y \right )} - 1\right ) \cos ^{2}{\left (y \right )}}\, dy = C_{1} - x \]