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)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 30, normalized size of antiderivative = 1.00, 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 12

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

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 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]

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.09, 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

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \log (\tan (x)) \sec ^4(x) \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.28, size = 39, normalized size = 1.30 \[ \frac {3 \, {\left (2 \, \cos \relax (x)^{2} + 1\right )} \log \left (\frac {\sin \relax (x)}{\cos \relax (x)}\right ) \sin \relax (x) - {\left (8 \, \cos \relax (x)^{2} + 1\right )} \sin \relax (x)}{9 \, \cos \relax (x)^{3}} \]

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

________________________________________________________________________________________

giac [A]  time = 0.95, size = 26, normalized size = 0.87 \[ \frac {1}{3} \, \log \left (\tan \relax (x)\right ) \tan \relax (x)^{3} - \frac {1}{9} \, \tan \relax (x)^{3} + \log \left (\tan \relax (x)\right ) \tan \relax (x) - \tan \relax (x) \]

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)

________________________________________________________________________________________

maple [B]  time = 0.52, size = 55, normalized size = 1.83




method result size



default \(\frac {\left (6 \left (\cos ^{2}\relax (x )\right ) \ln \relax (2)+6 \left (\cos ^{2}\relax (x )\right ) \ln \left (\frac {\sin \relax (x )}{2 \cos \relax (x )}\right )-8 \left (\cos ^{2}\relax (x )\right )+3 \ln \relax (2)+3 \ln \left (\frac {\sin \relax (x )}{2 \cos \relax (x )}\right )-1\right ) \sin \relax (x )}{9 \cos \relax (x )^{3}}\) \(55\)
risch \(-\frac {4 i \left (3 \,{\mathrm e}^{2 i x}+1\right ) \ln \left (1+{\mathrm e}^{2 i x}\right )}{3 \left (1+{\mathrm e}^{2 i x}\right )^{3}}+\frac {\frac {2 \pi }{3}+\frac {2 \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{3}}{3}-\frac {2 \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} \pi }{3}+2 \pi \,{\mathrm e}^{2 i x}+\frac {2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{3}}{3}-\frac {2 \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \pi }{3}-2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-\frac {2 \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \pi }{3}+\frac {2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )}{3}+\frac {2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{6 i x}}{3}+2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{4 i x}-\frac {2 i {\mathrm e}^{6 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )}{3}-2 i {\mathrm e}^{4 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )+2 i {\mathrm e}^{2 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )-\frac {2 \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \pi }{3}+2 \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{3} {\mathrm e}^{2 i x}+2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{3} {\mathrm e}^{2 i x}-\frac {16 i}{9}-4 i {\mathrm e}^{2 i x}+\frac {2 i \ln \left (1+{\mathrm e}^{2 i x}\right )}{3}-\frac {4 i {\mathrm e}^{4 i x}}{3}+2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{2 i x}+\frac {2 i \ln \left ({\mathrm e}^{2 i x}-1\right )}{3}-2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-2 \pi \,\mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}+\frac {2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )}{3}+2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right ) {\mathrm e}^{2 i x}+2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) {\mathrm e}^{2 i x}}{\left (1+{\mathrm e}^{2 i x}\right )^{3}}\) \(782\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(tan(x))/cos(x)^4,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.43, size = 25, normalized size = 0.83 \[ -\frac {1}{9} \, \tan \relax (x)^{3} + \frac {1}{3} \, {\left (\tan \relax (x)^{3} + 3 \, \tan \relax (x)\right )} \log \left (\tan \relax (x)\right ) - \tan \relax (x) \]

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)

________________________________________________________________________________________

mupad [B]  time = 1.80, size = 148, normalized size = 4.93 \[ \frac {\ln \left (-\frac {8\,{\mathrm {e}}^{x\,2{}\mathrm {i}}}{3}-\frac {8}{3}\right )\,2{}\mathrm {i}}{3}-\frac {\ln \left (\frac {8}{3}-\frac {8\,{\mathrm {e}}^{x\,2{}\mathrm {i}}}{3}\right )\,2{}\mathrm {i}}{3}+\frac {8{}\mathrm {i}}{9\,\left (3\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{x\,4{}\mathrm {i}}+{\mathrm {e}}^{x\,6{}\mathrm {i}}+1\right )}-\frac {4{}\mathrm {i}}{3\,\left (2\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+{\mathrm {e}}^{x\,4{}\mathrm {i}}+1\right )}-\frac {4{}\mathrm {i}}{3\,\left ({\mathrm {e}}^{x\,2{}\mathrm {i}}+1\right )}+\frac {\ln \left (-\frac {{\mathrm {e}}^{x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}+1}\right )\,\left ({\mathrm {e}}^{x\,2{}\mathrm {i}}\,4{}\mathrm {i}+\frac {4}{3}{}\mathrm {i}\right )}{3\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{x\,4{}\mathrm {i}}+{\mathrm {e}}^{x\,6{}\mathrm {i}}+1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(log(- (8*exp(x*2i))/3 - 8/3)*2i)/3 - (log(8/3 - (8*exp(x*2i))/3)*2i)/3 + 8i/(9*(3*exp(x*2i) + 3*exp(x*4i) + e
xp(x*6i) + 1)) - 4i/(3*(2*exp(x*2i) + exp(x*4i) + 1)) - 4i/(3*(exp(x*2i) + 1)) + (log(-(exp(x*2i)*1i - 1i)/(ex
p(x*2i) + 1))*(exp(x*2i)*4i + 4i/3))/(3*exp(x*2i) + 3*exp(x*4i) + exp(x*6i) + 1)

________________________________________________________________________________________

sympy [A]  time = 20.46, size = 46, normalized size = 1.53 \[ \frac {\log {\left (\tan {\relax (x )} \right )} \tan ^{3}{\relax (x )}}{3} + \log {\left (\tan {\relax (x )} \right )} \tan {\relax (x )} - \frac {\sin ^{3}{\relax (x )}}{9 \cos ^{3}{\relax (x )}} + \frac {\sin {\relax (x )}}{3 \cos {\relax (x )}} - \frac {4 \tan {\relax (x )}}{3} \]

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

________________________________________________________________________________________