19.1.6 problem 6

Internal problem ID [4218]
Book : Advanced Mathematica, Book2, Perkin and Perkin, 1992
Section : Chapter 11.3, page 316
Problem number : 6
Date solved : Tuesday, September 30, 2025 at 07:07:35 AM
CAS classification : [_quadrature]

\begin{align*} y^{\prime }&=3 \cos \left (y\right )^{2} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 12
ode:=diff(y(x),x) = 3*cos(y(x))^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \arctan \left (3 x +3 c_1 \right ) \]
Mathematica. Time used: 0.228 (sec). Leaf size: 32
ode=D[y[x],x]==3*Cos[y[x]]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \arctan (3 x+2 c_1)\\ y(x)&\to -\frac {\pi }{2}\\ y(x)&\to \frac {\pi }{2} \end{align*}
Sympy. Time used: 0.763 (sec). Leaf size: 63
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*cos(y(x))**2 + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = 2 \operatorname {atan}{\left (\frac {\sqrt {C_{1}^{2} + 6 C_{1} x + 9 x^{2} + 1} - 1}{C_{1} + 3 x} \right )}, \ y{\left (x \right )} = - 2 \operatorname {atan}{\left (\frac {\sqrt {C_{1}^{2} + 6 C_{1} x + 9 x^{2} + 1} + 1}{C_{1} + 3 x} \right )}\right ] \]