3.81 \(\int \log (\cos (x)) \sec ^2(x) \, dx\)

Optimal. Leaf size=12 \[ -x+\tan (x)+\tan (x) \log (\cos (x)) \]

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 12, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 4, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3767, 8, 2554, 3473} \[ -x+\tan (x)+\tan (x) \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[Log[Cos[x]]*Sec[x]^2,x]

[Out]

-x + Tan[x] + Log[Cos[x]]*Tan[x]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, 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 3473

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

________________________________________________________________________________________

Mathematica [A]  time = 0.02, size = 12, normalized size = 1.00 \[ -x+\tan (x)+\tan (x) \log (\cos (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Log[Cos[x]]*Sec[x]^2,x]

[Out]

-x + Tan[x] + Log[Cos[x]]*Tan[x]

________________________________________________________________________________________

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

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[Log[Cos[x]]*Sec[x]^2,x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.01, size = 22, normalized size = 1.83 \[ -\frac {x \cos \relax (x) - \log \left (\cos \relax (x)\right ) \sin \relax (x) - \sin \relax (x)}{\cos \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(x))*sec(x)^2,x, algorithm="fricas")

[Out]

-(x*cos(x) - log(cos(x))*sin(x) - sin(x))/cos(x)

________________________________________________________________________________________

giac [A]  time = 0.99, size = 12, normalized size = 1.00 \[ \log \left (\cos \relax (x)\right ) \tan \relax (x) - x + \tan \relax (x) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(x))*sec(x)^2,x, algorithm="giac")

[Out]

log(cos(x))*tan(x) - x + tan(x)

________________________________________________________________________________________

maple [B]  time = 0.27, size = 57, normalized size = 4.75




method result size



norman \(\frac {x -x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-2 \tan \left (\frac {x}{2}\right ) \ln \left (\frac {1-\left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{1+\tan ^{2}\left (\frac {x}{2}\right )}\right )-2 \tan \left (\frac {x}{2}\right )}{\tan ^{2}\left (\frac {x}{2}\right )-1}\) \(57\)
default \(-4 i \left (\frac {\frac {{\mathrm e}^{2 i x} \ln \left (\left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{-i x}\right )}{2}-\frac {1}{2}}{1+{\mathrm e}^{2 i x}}-\frac {\ln \left (1+{\mathrm e}^{2 i x}\right )}{4}+\frac {\ln \relax (2)}{2+2 \,{\mathrm e}^{2 i x}}\right )\) \(67\)
risch \(-\frac {2 i \ln \left ({\mathrm e}^{i x}\right )}{1+{\mathrm e}^{2 i x}}+\frac {\pi \,\mathrm {csgn}\left (i \left (1+{\mathrm e}^{2 i x}\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-i x}\right ) \mathrm {csgn}\left (i \cos \relax (x )\right )-\pi \,\mathrm {csgn}\left (i \left (1+{\mathrm e}^{2 i x}\right )\right ) \mathrm {csgn}\left (i \cos \relax (x )\right )^{2}-\pi \,\mathrm {csgn}\left (i {\mathrm e}^{-i x}\right ) \mathrm {csgn}\left (i \cos \relax (x )\right )^{2}+\pi \mathrm {csgn}\left (i \cos \relax (x )\right )^{3}-i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{2 i x}-2 x \,{\mathrm e}^{2 i x}-2 i \ln \relax (2)+i \ln \left (1+{\mathrm e}^{2 i x}\right )+2 i-2 x}{1+{\mathrm e}^{2 i x}}\) \(156\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(cos(x))*sec(x)^2,x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.97, size = 94, normalized size = 7.83 \[ -\frac {2 \, \log \left (-\frac {\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - 1}{\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} + 1}\right ) \sin \relax (x)}{{\left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - 1\right )} {\left (\cos \relax (x) + 1\right )}} - \frac {2 \, \sin \relax (x)}{{\left (\frac {\sin \relax (x)^{2}}{{\left (\cos \relax (x) + 1\right )}^{2}} - 1\right )} {\left (\cos \relax (x) + 1\right )}} - 2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(x))*sec(x)^2,x, algorithm="maxima")

[Out]

-2*log(-(sin(x)^2/(cos(x) + 1)^2 - 1)/(sin(x)^2/(cos(x) + 1)^2 + 1))*sin(x)/((sin(x)^2/(cos(x) + 1)^2 - 1)*(co
s(x) + 1)) - 2*sin(x)/((sin(x)^2/(cos(x) + 1)^2 - 1)*(cos(x) + 1)) - 2*arctan(sin(x)/(cos(x) + 1))

________________________________________________________________________________________

mupad [B]  time = 0.43, size = 35, normalized size = 2.92 \[ \mathrm {tan}\relax (x)-2\,x+\ln \left (\cos \relax (x)\right )\,\mathrm {tan}\relax (x)+\ln \left (\cos \relax (x)\right )\,1{}\mathrm {i}-\ln \left (\cos \left (2\,x\right )+1+\sin \left (2\,x\right )\,1{}\mathrm {i}\right )\,1{}\mathrm {i} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(cos(x))/cos(x)^2,x)

[Out]

log(cos(x))*1i - 2*x - log(cos(2*x) + sin(2*x)*1i + 1)*1i + tan(x) + log(cos(x))*tan(x)

________________________________________________________________________________________

sympy [A]  time = 20.57, size = 15, normalized size = 1.25 \[ - x + \log {\left (\cos {\relax (x )} \right )} \tan {\relax (x )} + \frac {\sin {\relax (x )}}{\cos {\relax (x )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(cos(x))*sec(x)**2,x)

[Out]

-x + log(cos(x))*tan(x) + sin(x)/cos(x)

________________________________________________________________________________________