3.643 \(\int \frac {\log (\cos (\frac {x}{2}))}{1+\cos (x)} \, dx\)

Optimal. Leaf size=28 \[ -\frac {x}{2}+\tan \left (\frac {x}{2}\right )+\frac {\sin (x) \log \left (\cos \left (\frac {x}{2}\right )\right )}{\cos (x)+1} \]

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 28, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {2648, 2554, 12, 3473, 8} \[ -\frac {x}{2}+\tan \left (\frac {x}{2}\right )+\frac {\sin (x) \log \left (\cos \left (\frac {x}{2}\right )\right )}{\cos (x)+1} \]

Antiderivative was successfully verified.

[In]

Int[Log[Cos[x/2]]/(1 + Cos[x]),x]

[Out]

-x/2 + (Log[Cos[x/2]]*Sin[x])/(1 + Cos[x]) + Tan[x/2]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

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 2648

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> -Simp[Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

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

________________________________________________________________________________________

Mathematica [A]  time = 0.10, size = 32, normalized size = 1.14 \[ -\frac {\sin (x) \left (x \cot \left (\frac {x}{2}\right )-2 \left (\log \left (\cos \left (\frac {x}{2}\right )\right )+1\right )\right )}{2 (\cos (x)+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Log[Cos[x/2]]/(1 + Cos[x]),x]

[Out]

-1/2*((x*Cot[x/2] - 2*(1 + Log[Cos[x/2]]))*Sin[x])/(1 + Cos[x])

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\log \left (\cos \left (\frac {x}{2}\right )\right )}{1+\cos (x)} \, dx \]

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[Log[Cos[x/2]]/(1 + Cos[x]),x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 0.90, size = 32, normalized size = 1.14 \[ -\frac {x \cos \left (\frac {1}{2} \, x\right ) - 2 \, \log \left (\cos \left (\frac {1}{2} \, x\right )\right ) \sin \left (\frac {1}{2} \, x\right ) - 2 \, \sin \left (\frac {1}{2} \, x\right )}{2 \, \cos \left (\frac {1}{2} \, x\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(1/2*x))/(1+cos(x)),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.92, size = 43, normalized size = 1.54 \[ -\frac {1}{2} \, x - \frac {2 \, \log \left (\cos \left (\frac {1}{2} \, x\right )\right ) \tan \left (\frac {1}{2} \, x\right )}{{\left (x^{2} + 1\right )} {\left (\frac {x^{2} - 1}{x^{2} + 1} - 1\right )}} + \tan \left (\frac {1}{2} \, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(1/2*x))/(1+cos(x)),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.25, size = 164, normalized size = 5.86




method result size



risch \(-\frac {2 i \ln \left ({\mathrm e}^{\frac {i x}{2}}\right )}{{\mathrm e}^{i x}+1}+\frac {-i \ln \left ({\mathrm e}^{i x}+1\right ) {\mathrm e}^{i x}+\pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{i x}+1\right )\right ) \mathrm {csgn}\left (i {\mathrm e}^{-\frac {i x}{2}}\right ) \mathrm {csgn}\left (i \cos \left (\frac {x}{2}\right )\right )-\pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{i x}+1\right )\right ) \mathrm {csgn}\left (i \cos \left (\frac {x}{2}\right )\right )^{2}-\pi \,\mathrm {csgn}\left (i {\mathrm e}^{-\frac {i x}{2}}\right ) \mathrm {csgn}\left (i \cos \left (\frac {x}{2}\right )\right )^{2}+\pi \mathrm {csgn}\left (i \cos \left (\frac {x}{2}\right )\right )^{3}-x \,{\mathrm e}^{i x}+i \ln \left ({\mathrm e}^{i x}+1\right )-2 i \ln \relax (2)+2 i-x}{{\mathrm e}^{i x}+1}\) \(164\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(cos(1/2*x))/(1+cos(x)),x,method=_RETURNVERBOSE)

[Out]

-2*I/(exp(I*x)+1)*ln(exp(1/2*I*x))+(-I*ln(exp(I*x)+1)*exp(I*x)+Pi*csgn(I*(exp(I*x)+1))*csgn(I*exp(-1/2*I*x))*c
sgn(I*cos(1/2*x))-Pi*csgn(I*(exp(I*x)+1))*csgn(I*cos(1/2*x))^2-Pi*csgn(I*exp(-1/2*I*x))*csgn(I*cos(1/2*x))^2+P
i*csgn(I*cos(1/2*x))^3-x*exp(I*x)+I*ln(exp(I*x)+1)-2*I*ln(2)+2*I-x)/(exp(I*x)+1)

________________________________________________________________________________________

maxima [B]  time = 0.44, size = 56, normalized size = 2.00 \[ \frac {\log \left (\cos \left (\frac {1}{2} \, x\right )\right ) \sin \relax (x)}{\cos \relax (x) + 1} - \frac {x \cos \relax (x)^{2} + x \sin \relax (x)^{2} + 2 \, x \cos \relax (x) + x - 4 \, \sin \relax (x)}{2 \, {\left (\cos \relax (x)^{2} + \sin \relax (x)^{2} + 2 \, \cos \relax (x) + 1\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(cos(1/2*x))/(1+cos(x)),x, algorithm="maxima")

[Out]

log(cos(1/2*x))*sin(x)/(cos(x) + 1) - 1/2*(x*cos(x)^2 + x*sin(x)^2 + 2*x*cos(x) + x - 4*sin(x))/(cos(x)^2 + si
n(x)^2 + 2*cos(x) + 1)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(cos(x/2))/(cos(x) + 1),x)

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\log {\left (\cos {\left (\frac {x}{2} \right )} \right )}}{\cos {\relax (x )} + 1}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(ln(cos(1/2*x))/(1+cos(x)),x)

[Out]

Integral(log(cos(x/2))/(cos(x) + 1), x)

________________________________________________________________________________________