18.1.14 problem Problem 14.16

Internal problem ID [3470]
Book : Mathematical methods for physics and engineering, Riley, Hobson, Bence, second edition, 2002
Section : Chapter 14, First order ordinary differential equations. 14.4 Exercises, page 490
Problem number : Problem 14.16
Date solved : Tuesday, March 04, 2025 at 04:41:17 PM
CAS classification : [_separable]

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

Maple. Time used: 0.196 (sec). Leaf size: 11
ode:=diff(y(x),x) = tan(x)*cos(y(x))*(cos(y(x))+sin(y(x))); 
dsolve(ode,y(x), singsol=all);
 
\[ y \left (x \right ) = \arctan \left (-1+\sec \left (x \right ) c_{1} \right ) \]
Mathematica. Time used: 60.475 (sec). Leaf size: 143
ode=D[y[x],x]==Tan[x]*Cos[y[x]]*( Cos[y[x]] + Sin[y[x]] ); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\arccos \left (-\frac {\cos (x)}{\sqrt {\cos (2 x)-2 e^{\frac {c_1}{2}} \cos (x)+1+e^{c_1}}}\right ) \\ y(x)\to \arccos \left (-\frac {\cos (x)}{\sqrt {\cos (2 x)-2 e^{\frac {c_1}{2}} \cos (x)+1+e^{c_1}}}\right ) \\ y(x)\to -\arccos \left (\frac {\cos (x)}{\sqrt {\cos (2 x)-2 e^{\frac {c_1}{2}} \cos (x)+1+e^{c_1}}}\right ) \\ y(x)\to \arccos \left (\frac {\cos (x)}{\sqrt {\cos (2 x)-2 e^{\frac {c_1}{2}} \cos (x)+1+e^{c_1}}}\right ) \\ \end{align*}
Sympy. Time used: 1.544 (sec). Leaf size: 34
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-sin(y(x)) - cos(y(x)))*cos(y(x))*tan(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = - \operatorname {atan}{\left (\frac {C_{1} + \sqrt {2} C_{1} - \sqrt {2} \cos {\left (x \right )} + \cos {\left (x \right )}}{C_{1} - \cos {\left (x \right )}} \right )} - \frac {\pi }{8} \]