4.1.31 \(y'(x)=y(x) \tan (x)+\sin (2 x)\)

ODE
\[ y'(x)=y(x) \tan (x)+\sin (2 x) \] ODE Classification

[_linear]

Book solution method
Linear ODE

Mathematica
cpu = 0.0185008 (sec), leaf count = 19

\[\left \{\left \{y(x)\to c_1 \sec (x)-\frac {2 \cos ^2(x)}{3}\right \}\right \}\]

Maple
cpu = 0.015 (sec), leaf count = 24

\[ \left \{ y \left ( x \right ) ={\frac {-\cos \left ( 3\,x \right ) -3\,\cos \left ( x \right ) +6\,{\it \_C1}}{6\,\cos \left ( x \right ) }} \right \} \] Mathematica raw input

DSolve[y'[x] == Sin[2*x] + Tan[x]*y[x],y[x],x]

Mathematica raw output

{{y[x] -> (-2*Cos[x]^2)/3 + C[1]*Sec[x]}}

Maple raw input

dsolve(diff(y(x),x) = sin(2*x)+y(x)*tan(x), y(x),'implicit')

Maple raw output

y(x) = 1/6*(-cos(3*x)-3*cos(x)+6*_C1)/cos(x)