3.487 \(\int x \cos ^2(x) \cot ^2(x) \, dx\)

Optimal. Leaf size=33 \[ -\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \sin (x) \cos (x) \]

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4408, 3310, 30, 3720, 3475} \[ -\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \sin (x) \cos (x) \]

Antiderivative was successfully verified.

[In]

Int[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[x]^2/4 - x*Cot[x] + Log[Sin[x]] - (x*Cos[x]*Sin[x])/2

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 3310

Int[((c_.) + (d_.)*(x_))*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(d*(b*Sin[e + f*x])^n)/(f^2*n
^2), x] + (Dist[(b^2*(n - 1))/n, Int[(c + d*x)*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[(b*(c + d*x)*Cos[e + f*
x]*(b*Sin[e + f*x])^(n - 1))/(f*n), x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3720

Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(c + d*x)^m*(b*Tan[e
 + f*x])^(n - 1))/(f*(n - 1)), x] + (-Dist[(b*d*m)/(f*(n - 1)), Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1)
, x], x] - Dist[b^2, Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n,
1] && GtQ[m, 0]

Rule 4408

Int[Cos[(a_.) + (b_.)*(x_)]^(n_.)*Cot[(a_.) + (b_.)*(x_)]^(p_.)*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> -Int[
(c + d*x)^m*Cos[a + b*x]^n*Cot[a + b*x]^(p - 2), x] + Int[(c + d*x)^m*Cos[a + b*x]^(n - 2)*Cot[a + b*x]^p, x]
/; FreeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int x \cos ^2(x) \cot ^2(x) \, dx &=-\int x \cos ^2(x) \, dx+\int x \cot ^2(x) \, dx\\ &=-\frac {1}{4} \cos ^2(x)-x \cot (x)-\frac {1}{2} x \cos (x) \sin (x)-\frac {\int x \, dx}{2}-\int x \, dx+\int \cot (x) \, dx\\ &=-\frac {3 x^2}{4}-\frac {\cos ^2(x)}{4}-x \cot (x)+\log (\sin (x))-\frac {1}{2} x \cos (x) \sin (x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 33, normalized size = 1.00 \[ -\frac {3 x^2}{4}-\frac {1}{4} x \sin (2 x)-\frac {1}{8} \cos (2 x)-x \cot (x)+\log (\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Cos[x]^2*Cot[x]^2,x]

[Out]

(-3*x^2)/4 - Cos[2*x]/8 - x*Cot[x] + Log[Sin[x]] - (x*Sin[2*x])/4

________________________________________________________________________________________

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

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[x*Cos[x]^2*Cot[x]^2,x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 1.09, size = 45, normalized size = 1.36 \[ \frac {4 \, x \cos \relax (x)^{3} - 12 \, x \cos \relax (x) - {\left (6 \, x^{2} + 2 \, \cos \relax (x)^{2} - 1\right )} \sin \relax (x) + 8 \, \log \left (\frac {1}{2} \, \sin \relax (x)\right ) \sin \relax (x)}{8 \, \sin \relax (x)} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^4/sin(x)^2,x, algorithm="fricas")

[Out]

1/8*(4*x*cos(x)^3 - 12*x*cos(x) - (6*x^2 + 2*cos(x)^2 - 1)*sin(x) + 8*log(1/2*sin(x))*sin(x))/sin(x)

________________________________________________________________________________________

giac [B]  time = 0.70, size = 206, normalized size = 6.24 \[ -\frac {6 \, x^{2} \tan \left (\frac {1}{2} \, x\right )^{5} - 4 \, x \tan \left (\frac {1}{2} \, x\right )^{6} - 4 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{5} + 12 \, x^{2} \tan \left (\frac {1}{2} \, x\right )^{3} - 12 \, x \tan \left (\frac {1}{2} \, x\right )^{4} + \tan \left (\frac {1}{2} \, x\right )^{5} - 8 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right )^{3} + 6 \, x^{2} \tan \left (\frac {1}{2} \, x\right ) + 12 \, x \tan \left (\frac {1}{2} \, x\right )^{2} - 6 \, \tan \left (\frac {1}{2} \, x\right )^{3} - 4 \, \log \left (\frac {16 \, \tan \left (\frac {1}{2} \, x\right )^{2}}{\tan \left (\frac {1}{2} \, x\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 1}\right ) \tan \left (\frac {1}{2} \, x\right ) + 4 \, x + \tan \left (\frac {1}{2} \, x\right )}{8 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{5} + 2 \, \tan \left (\frac {1}{2} \, x\right )^{3} + \tan \left (\frac {1}{2} \, x\right )\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^4/sin(x)^2,x, algorithm="giac")

[Out]

-1/8*(6*x^2*tan(1/2*x)^5 - 4*x*tan(1/2*x)^6 - 4*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1
/2*x)^5 + 12*x^2*tan(1/2*x)^3 - 12*x*tan(1/2*x)^4 + tan(1/2*x)^5 - 8*log(16*tan(1/2*x)^2/(tan(1/2*x)^4 + 2*tan
(1/2*x)^2 + 1))*tan(1/2*x)^3 + 6*x^2*tan(1/2*x) + 12*x*tan(1/2*x)^2 - 6*tan(1/2*x)^3 - 4*log(16*tan(1/2*x)^2/(
tan(1/2*x)^4 + 2*tan(1/2*x)^2 + 1))*tan(1/2*x) + 4*x + tan(1/2*x))/(tan(1/2*x)^5 + 2*tan(1/2*x)^3 + tan(1/2*x)
)

________________________________________________________________________________________

maple [C]  time = 0.07, size = 60, normalized size = 1.82




method result size



risch \(-\frac {3 x^{2}}{4}+\frac {i \left (2 x +i\right ) {\mathrm e}^{2 i x}}{16}-\frac {i \left (-i+2 x \right ) {\mathrm e}^{-2 i x}}{16}-2 i x -\frac {2 i x}{{\mathrm e}^{2 i x}-1}+\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(60\)
norman \(\frac {-\frac {\tan \left (\frac {x}{2}\right )}{2}-\frac {\left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{2}-\frac {x}{2}-\frac {3 x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}+\frac {3 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2}+\frac {x \left (\tan ^{6}\left (\frac {x}{2}\right )\right )}{2}-\frac {3 x^{2} \tan \left (\frac {x}{2}\right )}{4}-\frac {3 x^{2} \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{2}-\frac {3 x^{2} \left (\tan ^{5}\left (\frac {x}{2}\right )\right )}{4}}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2} \tan \left (\frac {x}{2}\right )}-\ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )+\ln \left (\tan \left (\frac {x}{2}\right )\right )\) \(111\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*cos(x)^4/sin(x)^2,x,method=_RETURNVERBOSE)

[Out]

-3/4*x^2+1/16*I*(2*x+I)*exp(2*I*x)-1/16*I*(-I+2*x)*exp(-2*I*x)-2*I*x-2*I*x/(exp(2*I*x)-1)+ln(exp(2*I*x)-1)

________________________________________________________________________________________

maxima [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)^4/sin(x)^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

mupad [B]  time = 0.49, size = 56, normalized size = 1.70 \[ \ln \left ({\mathrm {e}}^{x\,2{}\mathrm {i}}-1\right )-{\mathrm {e}}^{-x\,2{}\mathrm {i}}\,\left (\frac {1}{16}+\frac {x\,1{}\mathrm {i}}{8}\right )+{\mathrm {e}}^{x\,2{}\mathrm {i}}\,\left (-\frac {1}{16}+\frac {x\,1{}\mathrm {i}}{8}\right )-\frac {3\,x^2}{4}-x\,2{}\mathrm {i}-\frac {x\,2{}\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}-1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x*cos(x)^4)/sin(x)^2,x)

[Out]

log(exp(x*2i) - 1) - x*2i - exp(-x*2i)*((x*1i)/8 + 1/16) + exp(x*2i)*((x*1i)/8 - 1/16) - (x*2i)/(exp(x*2i) - 1
) - (3*x^2)/4

________________________________________________________________________________________

sympy [B]  time = 2.01, size = 507, normalized size = 15.36 \[ - \frac {3 x^{2} \tan ^{5}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {6 x^{2} \tan ^{3}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {3 x^{2} \tan {\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {2 x \tan ^{6}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {6 x \tan ^{4}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {6 x \tan ^{2}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {2 x}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {4 \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{5}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {8 \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan ^{3}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} - \frac {4 \log {\left (\tan ^{2}{\left (\frac {x}{2} \right )} + 1 \right )} \tan {\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {4 \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} \tan ^{5}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {8 \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} \tan ^{3}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {4 \log {\left (\tan {\left (\frac {x}{2} \right )} \right )} \tan {\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} + \frac {4 \tan ^{3}{\left (\frac {x}{2} \right )}}{4 \tan ^{5}{\left (\frac {x}{2} \right )} + 8 \tan ^{3}{\left (\frac {x}{2} \right )} + 4 \tan {\left (\frac {x}{2} \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*cos(x)**4/sin(x)**2,x)

[Out]

-3*x**2*tan(x/2)**5/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 6*x**2*tan(x/2)**3/(4*tan(x/2)**5 + 8*tan(x
/2)**3 + 4*tan(x/2)) - 3*x**2*tan(x/2)/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) + 2*x*tan(x/2)**6/(4*tan(x
/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) + 6*x*tan(x/2)**4/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 6*x*tan(
x/2)**2/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 2*x/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 4*lo
g(tan(x/2)**2 + 1)*tan(x/2)**5/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 8*log(tan(x/2)**2 + 1)*tan(x/2)*
*3/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) - 4*log(tan(x/2)**2 + 1)*tan(x/2)/(4*tan(x/2)**5 + 8*tan(x/2)*
*3 + 4*tan(x/2)) + 4*log(tan(x/2))*tan(x/2)**5/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) + 8*log(tan(x/2))*
tan(x/2)**3/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2)) + 4*log(tan(x/2))*tan(x/2)/(4*tan(x/2)**5 + 8*tan(x/2
)**3 + 4*tan(x/2)) + 4*tan(x/2)**3/(4*tan(x/2)**5 + 8*tan(x/2)**3 + 4*tan(x/2))

________________________________________________________________________________________