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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-x + Tan[x] + Log[Cos[x]]*Tan[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]

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]

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.0165154, size = 12, normalized size = 1. $-x+\tan (x)+\tan (x) \log (\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C]  time = 0.04, size = 61, normalized size = 5.1 \begin{align*}{\frac{-2\,i{{\rm e}^{2\,ix}}\ln \left ( 2\,\cos \left ( x \right ) \right ) }{1+{{\rm e}^{2\,ix}}}}+{\frac{2\,i}{1+{{\rm e}^{2\,ix}}}}+i\ln \left ( 1+{{\rm e}^{2\,ix}} \right ) -{\frac{2\,i\ln \left ( 2 \right ) }{1+{{\rm e}^{2\,ix}}}} \end{align*}

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

[In]

int(ln(cos(x))*sec(x)^2,x)

[Out]

-2*I/(1+exp(2*I*x))*exp(2*I*x)*ln(2*cos(x))+2*I/(1+exp(2*I*x))+I*ln(1+exp(2*I*x))-2*I*ln(2)/(1+exp(2*I*x))

________________________________________________________________________________________

Maxima [B]  time = 1.49995, size = 127, normalized size = 10.58 \begin{align*} -\frac{2 \, \log \left (-\frac{\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1}{\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} + 1}\right ) \sin \left (x\right )}{{\left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1\right )}{\left (\cos \left (x\right ) + 1\right )}} - \frac{2 \, \sin \left (x\right )}{{\left (\frac{\sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - 1\right )}{\left (\cos \left (x\right ) + 1\right )}} - 2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Veriﬁcation 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))

________________________________________________________________________________________

Fricas [A]  time = 2.19744, size = 68, normalized size = 5.67 \begin{align*} -\frac{x \cos \left (x\right ) - \log \left (\cos \left (x\right )\right ) \sin \left (x\right ) - \sin \left (x\right )}{\cos \left (x\right )} \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Sympy [A]  time = 137.984, size = 15, normalized size = 1.25 \begin{align*} - x + \log{\left (\cos{\left (x \right )} \right )} \tan{\left (x \right )} + \frac{\sin{\left (x \right )}}{\cos{\left (x \right )}} \end{align*}

Veriﬁcation 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)

________________________________________________________________________________________

Giac [A]  time = 1.21604, size = 16, normalized size = 1.33 \begin{align*} \log \left (\cos \left (x\right )\right ) \tan \left (x\right ) - x + \tan \left (x\right ) \end{align*}

Veriﬁcation 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)