83.8.4 problem 4

Internal problem ID [21957]
Book : Differential Equations By Kaj L. Nielsen. Second edition 1966. Barnes and nobel. 66-28306
Section : Chapter III. First order differential equations of the first degree. Ex. IX at page 55
Problem number : 4
Date solved : Thursday, October 02, 2025 at 08:19:50 PM
CAS classification : [_Bernoulli]

\begin{align*} y y^{\prime }+y^{2} \tan \left (x \right )&=\cos \left (x \right )^{2} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 28
ode:=y(x)*diff(y(x),x)+y(x)^2*tan(x) = cos(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\begin{align*} y &= \sqrt {2 x +c_1}\, \cos \left (x \right ) \\ y &= -\sqrt {2 x +c_1}\, \cos \left (x \right ) \\ \end{align*}
Mathematica. Time used: 0.176 (sec). Leaf size: 36
ode=y[x]*D[y[x],x]+y[x]^2*Tan[x]==Cos[x]^2 ; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\sqrt {2 x+c_1} \cos (x)\\ y(x)&\to \sqrt {2 x+c_1} \cos (x) \end{align*}
Sympy. Time used: 0.273 (sec). Leaf size: 29
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)**2*tan(x) + y(x)*Derivative(y(x), x) - cos(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - \sqrt {C_{1} + 2 x} \cos {\left (x \right )}, \ y{\left (x \right )} = \sqrt {C_{1} + 2 x} \cos {\left (x \right )}\right ] \]