3.642 \(\int \log (\tan (x)) \sec ^4(x) \, dx\)

Optimal. Leaf size=30 \[ -\frac{\tan ^3(x)}{9}-\tan (x)+\frac{1}{3} \tan ^3(x) \log (\tan (x))+\tan (x) \log (\tan (x)) \]

[Out]

-Tan[x] + Log[Tan[x]]*Tan[x] - Tan[x]^3/9 + (Log[Tan[x]]*Tan[x]^3)/3

________________________________________________________________________________________

Rubi [A]  time = 0.0582128, antiderivative size = 30, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.375, Rules used = {3767, 2554, 12} \[ -\frac{\tan ^3(x)}{9}-\tan (x)+\frac{1}{3} \tan ^3(x) \log (\tan (x))+\tan (x) \log (\tan (x)) \]

Antiderivative was successfully verified.

[In]

Int[Log[Tan[x]]*Sec[x]^4,x]

[Out]

-Tan[x] + Log[Tan[x]]*Tan[x] - Tan[x]^3/9 + (Log[Tan[x]]*Tan[x]^3)/3

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 2554

Int[Log[u_]*(v_), x_Symbol] :> With[{w = IntHide[v, x]}, Dist[Log[u], w, x] - Int[SimplifyIntegrand[(w*D[u, x]
)/u, x], x] /; InverseFunctionFreeQ[w, x]] /; InverseFunctionFreeQ[u, x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rubi steps

\begin{align*} \int \log (\tan (x)) \sec ^4(x) \, dx &=\log (\tan (x)) \tan (x)+\frac{1}{3} \log (\tan (x)) \tan ^3(x)-\int \frac{1}{3} (2+\cos (2 x)) \sec ^4(x) \, dx\\ &=\log (\tan (x)) \tan (x)+\frac{1}{3} \log (\tan (x)) \tan ^3(x)-\frac{1}{3} \int (2+\cos (2 x)) \sec ^4(x) \, dx\\ &=\log (\tan (x)) \tan (x)+\frac{1}{3} \log (\tan (x)) \tan ^3(x)-\frac{1}{3} \operatorname{Subst}\left (\int \left (3+x^2\right ) \, dx,x,\tan (x)\right )\\ &=-\tan (x)+\log (\tan (x)) \tan (x)-\frac{\tan ^3(x)}{9}+\frac{1}{3} \log (\tan (x)) \tan ^3(x)\\ \end{align*}

Mathematica [A]  time = 0.0709439, size = 29, normalized size = 0.97 \[ \frac{1}{9} \tan (x) \left (\sec ^2(x) (6 \log (\tan (x))+3 \cos (2 x) \log (\tan (x))-1)-8\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Log[Tan[x]]*Sec[x]^4,x]

[Out]

((-8 + (-1 + 6*Log[Tan[x]] + 3*Cos[2*x]*Log[Tan[x]])*Sec[x]^2)*Tan[x])/9

________________________________________________________________________________________

Maple [B]  time = 0.153, size = 55, normalized size = 1.8 \begin{align*}{\frac{\sin \left ( x \right ) }{9\, \left ( \cos \left ( x \right ) \right ) ^{3}} \left ( 6\, \left ( \cos \left ( x \right ) \right ) ^{2}\ln \left ( 1/2\,{\frac{\sin \left ( x \right ) }{\cos \left ( x \right ) }} \right ) +6\, \left ( \cos \left ( x \right ) \right ) ^{2}\ln \left ( 2 \right ) -8\, \left ( \cos \left ( x \right ) \right ) ^{2}+3\,\ln \left ( 1/2\,{\frac{\sin \left ( x \right ) }{\cos \left ( x \right ) }} \right ) +3\,\ln \left ( 2 \right ) -1 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(tan(x))/cos(x)^4,x)

[Out]

1/9*(6*cos(x)^2*ln(1/2*sin(x)/cos(x))+6*cos(x)^2*ln(2)-8*cos(x)^2+3*ln(1/2*sin(x)/cos(x))+3*ln(2)-1)*sin(x)/co
s(x)^3

________________________________________________________________________________________

Maxima [A]  time = 0.944442, size = 34, normalized size = 1.13 \begin{align*} -\frac{1}{9} \, \tan \left (x\right )^{3} + \frac{1}{3} \,{\left (\tan \left (x\right )^{3} + 3 \, \tan \left (x\right )\right )} \log \left (\tan \left (x\right )\right ) - \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(tan(x))/cos(x)^4,x, algorithm="maxima")

[Out]

-1/9*tan(x)^3 + 1/3*(tan(x)^3 + 3*tan(x))*log(tan(x)) - tan(x)

________________________________________________________________________________________

Fricas [A]  time = 2.61341, size = 117, normalized size = 3.9 \begin{align*} \frac{3 \,{\left (2 \, \cos \left (x\right )^{2} + 1\right )} \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right )}\right ) \sin \left (x\right ) -{\left (8 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{9 \, \cos \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(tan(x))/cos(x)^4,x, algorithm="fricas")

[Out]

1/9*(3*(2*cos(x)^2 + 1)*log(sin(x)/cos(x))*sin(x) - (8*cos(x)^2 + 1)*sin(x))/cos(x)^3

________________________________________________________________________________________

Sympy [A]  time = 160.155, size = 46, normalized size = 1.53 \begin{align*} \frac{\log{\left (\tan{\left (x \right )} \right )} \tan ^{3}{\left (x \right )}}{3} + \log{\left (\tan{\left (x \right )} \right )} \tan{\left (x \right )} - \frac{\sin ^{3}{\left (x \right )}}{9 \cos ^{3}{\left (x \right )}} + \frac{\sin{\left (x \right )}}{3 \cos{\left (x \right )}} - \frac{4 \tan{\left (x \right )}}{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(tan(x))/cos(x)**4,x)

[Out]

log(tan(x))*tan(x)**3/3 + log(tan(x))*tan(x) - sin(x)**3/(9*cos(x)**3) + sin(x)/(3*cos(x)) - 4*tan(x)/3

________________________________________________________________________________________

Giac [A]  time = 1.06601, size = 35, normalized size = 1.17 \begin{align*} \frac{1}{3} \, \log \left (\tan \left (x\right )\right ) \tan \left (x\right )^{3} - \frac{1}{9} \, \tan \left (x\right )^{3} + \log \left (\tan \left (x\right )\right ) \tan \left (x\right ) - \tan \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(tan(x))/cos(x)^4,x, algorithm="giac")

[Out]

1/3*log(tan(x))*tan(x)^3 - 1/9*tan(x)^3 + log(tan(x))*tan(x) - tan(x)