### 3.13 $$\int \tan (x) \, dx$$

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

[Out]

-Log[Cos[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.0020498, antiderivative size = 5, normalized size of antiderivative = 1., number of steps used = 1, number of rules used = 1, integrand size = 2, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.5, Rules used = {3475} $-\log (\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

Int[Tan[x],x]

[Out]

-Log[Cos[x]]

Rule 3475

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

Rubi steps

\begin{align*} \int \tan (x) \, dx &=-\log (\cos (x))\\ \end{align*}

Mathematica [A]  time = 0.0022787, size = 5, normalized size = 1. $-\log (\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Tan[x],x]

[Out]

-Log[Cos[x]]

________________________________________________________________________________________

Maple [A]  time = 0., size = 6, normalized size = 1.2 \begin{align*} -\ln \left ( \cos \left ( x \right ) \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x),x)

[Out]

-ln(cos(x))

________________________________________________________________________________________

Maxima [A]  time = 0.928878, size = 4, normalized size = 0.8 \begin{align*} \log \left (\sec \left (x\right )\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(sec(x))

________________________________________________________________________________________

Fricas [B]  time = 2.00598, size = 38, normalized size = 7.6 \begin{align*} -\frac{1}{2} \, \log \left (\frac{1}{\tan \left (x\right )^{2} + 1}\right ) \end{align*}

Veriﬁcation 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.05756, size = 5, normalized size = 1. \begin{align*} - \log{\left (\cos{\left (x \right )} \right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x),x)

[Out]

-log(cos(x))

________________________________________________________________________________________

Giac [A]  time = 1.05968, size = 8, normalized size = 1.6 \begin{align*} -\log \left ({\left | \cos \left (x\right ) \right |}\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-log(abs(cos(x)))