\(\int (\cos (x)+\sec (x)) \tan (x) \, dx\) [634]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 7 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=-\cos (x)+\sec (x) \]

[Out]

-cos(x)+sec(x)

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4321} \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=\sec (x)-\cos (x) \]

[In]

Int[(Cos[x] + Sec[x])*Tan[x],x]

[Out]

-Cos[x] + Sec[x]

Rule 4321

Int[(u_)*((A_.) + cos[(a_.) + (b_.)*(x_)]*(B_.) + (C_.)*sec[(a_.) + (b_.)*(x_)]), x_Symbol] :> Int[ActivateTri
g[u]*((C + A*Cos[a + b*x] + B*Cos[a + b*x]^2)/Cos[a + b*x]), x] /; FreeQ[{a, b, A, B, C}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (1+\cos ^2(x)\right ) \sec (x) \tan (x) \, dx \\ & = -\text {Subst}\left (\int \left (1+\frac {1}{x^2}\right ) \, dx,x,\cos (x)\right ) \\ & = -\cos (x)+\sec (x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=-\cos (x)+\sec (x) \]

[In]

Integrate[(Cos[x] + Sec[x])*Tan[x],x]

[Out]

-Cos[x] + Sec[x]

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.43

method result size
default \(\frac {1}{\cos \left (x \right )}-\cos \left (x \right )\) \(10\)
parts \(\frac {1}{\cos \left (x \right )}-\cos \left (x \right )\) \(10\)
risch \(-\frac {{\mathrm e}^{3 i x}-\cos \left (x \right )-3 i \sin \left (x \right )}{2 \left ({\mathrm e}^{2 i x}+1\right )}\) \(27\)

[In]

int((1/cos(x)+cos(x))*tan(x),x,method=_RETURNVERBOSE)

[Out]

1/cos(x)-cos(x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.71 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=-\frac {\cos \left (x\right )^{2} - 1}{\cos \left (x\right )} \]

[In]

integrate((1/cos(x)+cos(x))*tan(x),x, algorithm="fricas")

[Out]

-(cos(x)^2 - 1)/cos(x)

Sympy [A] (verification not implemented)

Time = 0.68 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=- \cos {\left (x \right )} + \frac {1}{\cos {\left (x \right )}} \]

[In]

integrate((1/cos(x)+cos(x))*tan(x),x)

[Out]

-cos(x) + 1/cos(x)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=\frac {1}{\cos \left (x\right )} - \cos \left (x\right ) \]

[In]

integrate((1/cos(x)+cos(x))*tan(x),x, algorithm="maxima")

[Out]

1/cos(x) - cos(x)

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=\frac {1}{\cos \left (x\right )} - \cos \left (x\right ) \]

[In]

integrate((1/cos(x)+cos(x))*tan(x),x, algorithm="giac")

[Out]

1/cos(x) - cos(x)

Mupad [B] (verification not implemented)

Time = 0.43 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29 \[ \int (\cos (x)+\sec (x)) \tan (x) \, dx=\frac {1}{\cos \left (x\right )}-\cos \left (x\right ) \]

[In]

int(tan(x)*(cos(x) + 1/cos(x)),x)

[Out]

1/cos(x) - cos(x)