3.4.75 \(\int \tan ^3(x) \, dx\) [375]

Optimal. Leaf size=12 \[ \log (\cos (x))+\frac {\tan ^2(x)}{2} \]

[Out]

ln(cos(x))+1/2*tan(x)^2

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Int[Tan[x]^3,x]

[Out]

Log[Cos[x]] + Tan[x]^2/2

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

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 {align*} \int \tan ^3(x) \, dx &=\frac {\tan ^2(x)}{2}-\int \tan (x) \, dx\\ &=\log (\cos (x))+\frac {\tan ^2(x)}{2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 12, normalized size = 1.00 \begin {gather*} \log (\cos (x))+\frac {\sec ^2(x)}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^3,x]

[Out]

Log[Cos[x]] + Sec[x]^2/2

________________________________________________________________________________________

Mathics [A]
time = 1.82, size = 10, normalized size = 0.83 \begin {gather*} \text {Log}\left [\text {Cos}\left [x\right ]\right ]+\frac {1}{2 \text {Cos}\left [x\right ]^2} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[Tan[x]^3,x]')

[Out]

Log[Cos[x]] + 1 / (2 Cos[x] ^ 2)

________________________________________________________________________________________

Maple [A]
time = 0.00, size = 17, normalized size = 1.42

method result size
derivativedivides \(\frac {\left (\tan ^{2}\left (x \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(17\)
default \(\frac {\left (\tan ^{2}\left (x \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(17\)
norman \(\frac {\left (\tan ^{2}\left (x \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}\) \(17\)
risch \(-i x +\frac {2 \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}+\ln \left ({\mathrm e}^{2 i x}+1\right )\) \(30\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 20, normalized size = 1.67 \begin {gather*} -\frac {1}{2 \, {\left (\sin \left (x\right )^{2} - 1\right )}} + \frac {1}{2} \, \log \left (\sin \left (x\right )^{2} - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.34, size = 18, normalized size = 1.50 \begin {gather*} \frac {1}{2} \, \tan \left (x\right )^{2} + \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)^3,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 12, normalized size = 1.00 \begin {gather*} \log {\left (\cos {\left (x \right )} \right )} + \frac {1}{2 \cos ^{2}{\left (x \right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**3,x)

[Out]

log(cos(x)) + 1/(2*cos(x)**2)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 16, normalized size = 1.33 \begin {gather*} \frac {\tan ^{2}x-\ln \left (\tan ^{2}x+1\right )}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^3,x)

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.02, size = 16, normalized size = 1.33 \begin {gather*} \ln \left (\cos \left (x\right )\right )-\frac {{\cos \left (x\right )}^2-1}{2\,{\cos \left (x\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^3,x)

[Out]

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

________________________________________________________________________________________