77.5.2 problem 2

Internal problem ID [20382]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter II. Equations of first order and first degree. Exercise II (D) at page 16
Problem number : 2
Date solved : Thursday, October 02, 2025 at 05:49:34 PM
CAS classification : [_linear]

\begin{align*} \cos \left (x \right )^{2} y^{\prime }+y&=\tan \left (x \right ) \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 15
ode:=cos(x)^2*diff(y(x),x)+y(x) = tan(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \tan \left (x \right )-1+{\mathrm e}^{-\tan \left (x \right )} c_1 \]
Mathematica. Time used: 0.057 (sec). Leaf size: 18
ode=Cos[x]^2*D[y[x],x]+y[x]==Tan[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \tan (x)+c_1 e^{-\tan (x)}-1 \end{align*}
Sympy. Time used: 144.819 (sec). Leaf size: 46
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + cos(x)**2*Derivative(y(x), x) - tan(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + \tilde {\infty } \int \frac {y{\left (x \right )} e^{\frac {\sin {\left (x \right )}}{\cos {\left (x \right )}}}}{\cos ^{2}{\left (x \right )}}\, dx + \tilde {\infty } \int \frac {e^{\tan {\left (x \right )}} \tan {\left (x \right )}}{\cos ^{2}{\left (x \right )}}\, dx\right ) e^{- \tan {\left (x \right )}} \]