15.6.14 problem 14

Internal problem ID [2971]
Book : Differential Equations by Alfred L. Nelson, Karl W. Folley, Max Coral. 3rd ed. DC heath. Boston. 1964
Section : Exercise 10, page 41
Problem number : 14
Date solved : Tuesday, March 04, 2025 at 03:36:31 PM
CAS classification : [[_1st_order, `_with_symmetry_[F(x)*G(y),0]`]]

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

Maple. Time used: 0.008 (sec). Leaf size: 18
ode:=cos(y(x))^2+(x-tan(y(x)))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (\operatorname {LambertW}\left (-c_{1} {\mathrm e}^{-x -1}\right )+x +1\right ) \]
Mathematica. Time used: 60.297 (sec). Leaf size: 21
ode=Cos[y[x]]^2+(x-Tan[y[x]])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \arctan \left (W\left (c_1 \left (-e^{-x-1}\right )\right )+x+1\right ) \]
Sympy. Time used: 85.283 (sec). Leaf size: 112
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - tan(y(x)))*Derivative(y(x), x) + cos(y(x))**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \frac {i \log {\left (- \frac {\log {\left (\frac {- C_{1} + \int \limits ^{C_{2}} \frac {e^{\tan {\left (y \right )}} \tan {\left (y \right )}}{\cos ^{2}{\left (y \right )}}\, dy}{x} \right )} - i}{\log {\left (\frac {- C_{1} + \int \limits ^{C_{2}} \frac {e^{\tan {\left (y \right )}} \tan {\left (y \right )}}{\cos ^{2}{\left (y \right )}}\, dy}{x} \right )} + i} \right )}}{2}, \ y{\left (x \right )} = - i \log {\left (- \sqrt {- \frac {\log {\left (\frac {- C_{1} + \int \limits ^{C_{2}} \frac {e^{\tan {\left (y \right )}} \tan {\left (y \right )}}{\cos ^{2}{\left (y \right )}}\, dy}{x} \right )} - i}{\log {\left (\frac {- C_{1} + \int \limits ^{C_{2}} \frac {e^{\tan {\left (y \right )}} \tan {\left (y \right )}}{\cos ^{2}{\left (y \right )}}\, dy}{x} \right )} + i}} \right )}\right ] \]