### 3.189 $$\int \cos (x) \log (\cos (x)) \, dx$$

Optimal. Leaf size=14 $-\sin (x)+\tanh ^{-1}(\sin (x))+\sin (x) \log (\cos (x))$

[Out]

ArcTanh[Sin[x]] - Sin[x] + Log[Cos[x]]*Sin[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0195638, antiderivative size = 14, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 5, integrand size = 6, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.833, Rules used = {2637, 2554, 2592, 321, 206} $-\sin (x)+\tanh ^{-1}(\sin (x))+\sin (x) \log (\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

Int[Cos[x]*Log[Cos[x]],x]

[Out]

ArcTanh[Sin[x]] - Sin[x] + Log[Cos[x]]*Sin[x]

Rule 2637

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, 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 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
c, n, m, p, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
/; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

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

Mathematica [B]  time = 0.0114056, size = 43, normalized size = 3.07 $-\sin (x)-\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )+\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )+\sin (x) \log (\cos (x))$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Cos[x]*Log[Cos[x]],x]

[Out]

-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]] - Sin[x] + Log[Cos[x]]*Sin[x]

________________________________________________________________________________________

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

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

[In]

int(cos(x)*ln(cos(x)),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.00651, size = 146, normalized size = 10.43 \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 )}} + \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \log \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end{align*}

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

[In]

integrate(cos(x)*log(cos(x)),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)*(cos
(x) + 1)) - 2*sin(x)/((sin(x)^2/(cos(x) + 1)^2 + 1)*(cos(x) + 1)) + log(sin(x)/(cos(x) + 1) + 1) - log(sin(x)/
(cos(x) + 1) - 1)

________________________________________________________________________________________

Fricas [A]  time = 2.39617, size = 100, normalized size = 7.14 \begin{align*} \log \left (\cos \left (x\right )\right ) \sin \left (x\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) - \sin \left (x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 3.28682, size = 223, normalized size = 15.93 \begin{align*} - \frac{\log{\left (- \frac{\tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{1}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{2 \log{\left (- \frac{\tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{1}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} \right )} \tan{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} - \frac{\log{\left (- \frac{\tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{1}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{2 \log{\left (\tan{\left (\frac{x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} + \frac{2 \log{\left (\tan{\left (\frac{x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} - \frac{\log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} - \frac{\log{\left (\tan ^{2}{\left (\frac{x}{2} \right )} + 1 \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} - \frac{2 \tan{\left (\frac{x}{2} \right )}}{\tan ^{2}{\left (\frac{x}{2} \right )} + 1} \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.19677, size = 36, normalized size = 2.57 \begin{align*} \log \left (\cos \left (x\right )\right ) \sin \left (x\right ) + \frac{1}{2} \, \log \left (\sin \left (x\right ) + 1\right ) - \frac{1}{2} \, \log \left (-\sin \left (x\right ) + 1\right ) - \sin \left (x\right ) \end{align*}

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

[In]

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

[Out]

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