38.2.24 problem 24

Internal problem ID [6453]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 24
Date solved : Sunday, March 30, 2025 at 11:01:39 AM
CAS classification : [_Bernoulli]

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

Maple. Time used: 0.003 (sec). Leaf size: 20
ode:=diff(y(x),x)-2*y(x)*tan(x) = y(x)^2*tan(x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {3 \sec \left (x \right )^{2}}{\tan \left (x \right )^{3}-3 c_1} \]
Mathematica. Time used: 0.507 (sec). Leaf size: 31
ode=D[y[x],x]-2*y[x]*Tan[x]==y[x]^2*Tan[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {3}{-\sin ^2(x) \tan (x)+3 c_1 \cos ^2(x)} \\ y(x)\to 0 \\ \end{align*}
Sympy. Time used: 0.343 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x)**2*tan(x)**2 - 2*y(x)*tan(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {3 \cos {\left (x \right )}}{C_{1} \cos ^{3}{\left (x \right )} + \sin {\left (x \right )} \cos ^{2}{\left (x \right )} - \sin {\left (x \right )}} \]