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

Optimal. Leaf size=7 \[ -\cos (x)+\sec (x) \]

[Out]

-cos(x)+sec(x)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4321} \begin {gather*} \sec (x)-\cos (x) \end {gather*}

Antiderivative was successfully verified.

[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*} \int (\cos (x)+\sec (x)) \tan (x) \, dx &=\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]
time = 0.00, size = 7, normalized size = 1.00 \begin {gather*} -\cos (x)+\sec (x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-Cos[x] + Sec[x]

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 10, normalized size = 1.43

method result size
derivativedivides \(-\cos \left (x \right )+\frac {1}{\cos \left (x \right )}\) \(10\)
default \(-\cos \left (x \right )+\frac {1}{\cos \left (x \right )}\) \(10\)
risch \(-\frac {{\mathrm e}^{i x}}{2}-\frac {{\mathrm e}^{-i x}}{2}+\frac {2 \,{\mathrm e}^{i x}}{{\mathrm e}^{2 i x}+1}\) \(32\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 2.58, size = 9, normalized size = 1.29 \begin {gather*} \frac {1}{\cos \left (x\right )} - \cos \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) - cos(x)

________________________________________________________________________________________

Fricas [A]
time = 0.89, size = 12, normalized size = 1.71 \begin {gather*} -\frac {\cos \left (x\right )^{2} - 1}{\cos \left (x\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.81, size = 7, normalized size = 1.00 \begin {gather*} - \cos {\left (x \right )} + \frac {1}{\cos {\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 1.36, size = 9, normalized size = 1.29 \begin {gather*} \frac {1}{\cos \left (x\right )} - \cos \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) - cos(x)

________________________________________________________________________________________

Mupad [B]
time = 0.39, size = 9, normalized size = 1.29 \begin {gather*} \frac {1}{\cos \left (x\right )}-\cos \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/cos(x) - cos(x)

________________________________________________________________________________________