3.1.11 \(\int \tan (x) \, dx\) [11]

Optimal. Leaf size=5 \[ -\log (\cos (x)) \]

[Out]

-ln(cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 5, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3556} \begin {gather*} -\log (\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[x],x]

[Out]

-Log[Cos[x]]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {gather*} \begin {aligned} \text {Integral} &=-\log (\cos (x))\\ \end {aligned} \end {gather*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 5, normalized size = 1.00 \begin {gather*} -\log (\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[x],x]

[Out]

-Log[Cos[x]]

________________________________________________________________________________________

Maple [A]
time = 0.01, size = 6, normalized size = 1.20

method result size
lookup \(-\ln \left (\cos \left (x \right )\right )\) \(6\)
default \(-\ln \left (\cos \left (x \right )\right )\) \(6\)
derivativedivides \(\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(10\)
norman \(\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(10\)
parallelrisch \(\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(10\)
risch \(i x -\ln \left ({\mathrm e}^{2 i x}+1\right )\) \(16\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x),x,method=_RETURNVERBOSE)

[Out]

-ln(cos(x))

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 3, normalized size = 0.60 \begin {gather*} \log \left (\sec \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x),x, algorithm="maxima")

[Out]

log(sec(x))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 11 vs. \(2 (5) = 10\).
time = 0.60, size = 11, normalized size = 2.20 \begin {gather*} -\frac {1}{2} \, \log \left (\frac {1}{\tan \left (x\right )^{2} + 1}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x),x, algorithm="fricas")

[Out]

-1/2*log(1/(tan(x)^2 + 1))

________________________________________________________________________________________

Sympy [A]
time = 0.02, size = 5, normalized size = 1.00 \begin {gather*} - \log {\left (\cos {\left (x \right )} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x),x)

[Out]

-log(cos(x))

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 6, normalized size = 1.20 \begin {gather*} -\log \left ({\left | \cos \left (x\right ) \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x),x, algorithm="giac")

[Out]

-log(abs(cos(x)))

________________________________________________________________________________________

Mupad [B]
time = 0.01, size = 5, normalized size = 1.00 \begin {gather*} -\ln \left (\cos \left (x\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x),x)

[Out]

-log(cos(x))

________________________________________________________________________________________