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)+ln(cos(x))*sin(x)

________________________________________________________________________________________

Rubi [A]  time = 0.02, antiderivative size = 14, normalized size of antiderivative = 1.00, 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 verified.

[In]

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

[Out]

ArcTanh[Sin[x]] - Sin[x] + Log[Cos[x]]*Sin[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])

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

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

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.02, 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 verified.

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

________________________________________________________________________________________

fricas [A]  time = 0.49, size = 27, normalized size = 1.93 \[ \log \left (\cos \relax (x)\right ) \sin \relax (x) + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) - \sin \relax (x) \]

Verification 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)

________________________________________________________________________________________

giac [A]  time = 0.18, size = 27, normalized size = 1.93 \[ \log \left (\cos \relax (x)\right ) \sin \relax (x) + \frac {1}{2} \, \log \left (\sin \relax (x) + 1\right ) - \frac {1}{2} \, \log \left (-\sin \relax (x) + 1\right ) - \sin \relax (x) \]

Verification 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)

________________________________________________________________________________________

maple [C]  time = 0.31, size = 73, normalized size = 5.21 \[ \frac {i {\mathrm e}^{-i x} \ln \left (2 \cos \relax (x )\right )}{2}-\frac {i {\mathrm e}^{i x} \ln \left (2 \cos \relax (x )\right )}{2}-2 i \arctan \left ({\mathrm e}^{i x}\right )-\frac {i \ln \relax (2) {\mathrm e}^{-i x}}{2}-\frac {i {\mathrm e}^{-i x}}{2}+\frac {i \ln \relax (2) {\mathrm e}^{i x}}{2}+\frac {i {\mathrm e}^{i x}}{2} \]

Verification 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)-2*I*arctan(exp(I*x))+1/2*I*exp(I*x)

________________________________________________________________________________________

maxima [B]  time = 0.45, size = 108, normalized size = 7.71 \[ \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 )}} + \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} + 1\right ) - \log \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1} - 1\right ) \]

Verification 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)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.07 \[ \int \ln \left (\cos \relax (x)\right )\,\cos \relax (x) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(cos(x))*cos(x),x)

[Out]

int(log(cos(x))*cos(x), x)

________________________________________________________________________________________

sympy [B]  time = 2.36, size = 223, normalized size = 15.93 \[ - \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} \]

Verification 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)

________________________________________________________________________________________