Integrand size = 12, antiderivative size = 83 \[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\frac {x}{4}-i x^2-\frac {x^3}{2}-\frac {1}{2} x \cos ^2(x)-x^2 \cot (x)+2 x \log \left (1-e^{2 i x}\right )-i \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {1}{4} \cos (x) \sin (x)-\frac {1}{2} x^2 \cos (x) \sin (x) \] Output:
1/4*x-I*x^2-1/2*x^3-1/2*x*cos(x)^2-x^2*cot(x)+2*x*ln(1-exp(2*I*x))-I*polyl og(2,exp(2*I*x))+1/4*cos(x)*sin(x)-1/2*x^2*cos(x)*sin(x)
Time = 0.08 (sec) , antiderivative size = 72, normalized size of antiderivative = 0.87 \[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\frac {1}{8} \left (-8 i x^2-4 x^3-2 x \cos (2 x)-8 x^2 \cot (x)+16 x \log \left (1-e^{2 i x}\right )-8 i \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\sin (2 x)-2 x^2 \sin (2 x)\right ) \] Input:
Integrate[x^2*Cos[x]^2*Cot[x]^2,x]
Output:
((-8*I)*x^2 - 4*x^3 - 2*x*Cos[2*x] - 8*x^2*Cot[x] + 16*x*Log[1 - E^((2*I)* x)] - (8*I)*PolyLog[2, E^((2*I)*x)] + Sin[2*x] - 2*x^2*Sin[2*x])/8
Time = 0.64 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.23, number of steps used = 18, number of rules used = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.417, Rules used = {4908, 3042, 3792, 15, 3042, 3115, 24, 4203, 15, 25, 3042, 25, 4200, 25, 2620, 2715, 2838}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int x^2 \cos ^2(x) \cot ^2(x) \, dx\) |
\(\Big \downarrow \) 4908 |
\(\displaystyle \int x^2 \cot ^2(x)dx-\int x^2 \cos ^2(x)dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx-\int x^2 \sin \left (x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3792 |
\(\displaystyle -\frac {\int x^2dx}{2}+\int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx+\frac {1}{2} \int \cos ^2(x)dx-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)\) |
\(\Big \downarrow \) 15 |
\(\displaystyle \int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx+\frac {1}{2} \int \cos ^2(x)dx-\frac {x^3}{6}-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx+\frac {1}{2} \int \sin \left (x+\frac {\pi }{2}\right )^2dx-\frac {x^3}{6}-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle \int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx+\frac {1}{2} \left (\frac {\int 1dx}{2}+\frac {1}{2} \sin (x) \cos (x)\right )-\frac {x^3}{6}-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \int x^2 \tan \left (x+\frac {\pi }{2}\right )^2dx-\frac {x^3}{6}-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 4203 |
\(\displaystyle -\int x^2dx-2 \int -x \cot (x)dx-\frac {x^3}{6}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 15 |
\(\displaystyle -2 \int -x \cot (x)dx-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle 2 \int x \cot (x)dx-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle 2 \int -x \tan \left (x+\frac {\pi }{2}\right )dx-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -2 \int x \tan \left (x+\frac {\pi }{2}\right )dx-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 4200 |
\(\displaystyle -2 \left (\frac {i x^2}{2}-2 i \int -\frac {e^{2 i x} x}{1-e^{2 i x}}dx\right )-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -2 \left (2 i \int \frac {e^{2 i x} x}{1-e^{2 i x}}dx+\frac {i x^2}{2}\right )-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle -2 \left (2 i \left (\frac {1}{2} i x \log \left (1-e^{2 i x}\right )-\frac {1}{2} i \int \log \left (1-e^{2 i x}\right )dx\right )+\frac {i x^2}{2}\right )-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle -2 \left (2 i \left (\frac {1}{2} i x \log \left (1-e^{2 i x}\right )-\frac {1}{4} \int e^{-2 i x} \log \left (1-e^{2 i x}\right )de^{2 i x}\right )+\frac {i x^2}{2}\right )-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle -2 \left (2 i \left (\frac {1}{4} \operatorname {PolyLog}\left (2,e^{2 i x}\right )+\frac {1}{2} i x \log \left (1-e^{2 i x}\right )\right )+\frac {i x^2}{2}\right )-\frac {x^3}{2}-x^2 \cot (x)-\frac {1}{2} x^2 \sin (x) \cos (x)-\frac {1}{2} x \cos ^2(x)+\frac {1}{2} \left (\frac {x}{2}+\frac {1}{2} \sin (x) \cos (x)\right )\) |
Input:
Int[x^2*Cos[x]^2*Cot[x]^2,x]
Output:
-1/2*x^3 - (x*Cos[x]^2)/2 - x^2*Cot[x] - 2*((I/2)*x^2 + (2*I)*((I/2)*x*Log [1 - E^((2*I)*x)] + PolyLog[2, E^((2*I)*x)]/4)) - (x^2*Cos[x]*Sin[x])/2 + (x/2 + (Cos[x]*Sin[x])/2)/2
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ ((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp [((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si mp[d*(m/(b*f*g*n*Log[F])) Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x )))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Simp[1/(d*e*n*Log[F]) Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) ))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 , (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[((c_.) + (d_.)*(x_))^(m_)*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbo l] :> Simp[d*m*(c + d*x)^(m - 1)*((b*Sin[e + f*x])^n/(f^2*n^2)), x] + (-Sim p[b*(c + d*x)^m*Cos[e + f*x]*((b*Sin[e + f*x])^(n - 1)/(f*n)), x] + Simp[b^ 2*((n - 1)/n) Int[(c + d*x)^m*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[d^2 *m*((m - 1)/(f^2*n^2)) Int[(c + d*x)^(m - 2)*(b*Sin[e + f*x])^n, x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1] && GtQ[m, 1]
Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + Pi*(k_.) + (f_.)*(x_)], x_Symbol ] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x] - Simp[2*I Int[(c + d*x)^ m*E^(2*I*k*Pi)*(E^(2*I*(e + f*x))/(1 + E^(2*I*k*Pi)*E^(2*I*(e + f*x)))), x] , x] /; FreeQ[{c, d, e, f}, x] && IntegerQ[4*k] && IGtQ[m, 0]
Int[((c_.) + (d_.)*(x_))^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symb ol] :> Simp[b*(c + d*x)^m*((b*Tan[e + f*x])^(n - 1)/(f*(n - 1))), x] + (-Si mp[b*d*(m/(f*(n - 1))) Int[(c + d*x)^(m - 1)*(b*Tan[e + f*x])^(n - 1), x] , x] - Simp[b^2 Int[(c + d*x)^m*(b*Tan[e + f*x])^(n - 2), x], x]) /; Free Q[{b, c, d, e, f}, x] && GtQ[n, 1] && GtQ[m, 0]
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] /; Fr eeQ[{a, b, c, d, m}, x] && IGtQ[n, 0] && IGtQ[p, 0]
Time = 0.64 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.35
method | result | size |
risch | \(-\frac {x^{3}}{2}+\frac {i \left (2 x^{2}+2 i x -1\right ) {\mathrm e}^{2 i x}}{16}-\frac {i \left (2 x^{2}-2 i x -1\right ) {\mathrm e}^{-2 i x}}{16}-\frac {2 i x^{2}}{{\mathrm e}^{2 i x}-1}+2 x \ln \left ({\mathrm e}^{i x}+1\right )+2 x \ln \left (1-{\mathrm e}^{i x}\right )-2 i x^{2}-2 i \operatorname {polylog}\left (2, -{\mathrm e}^{i x}\right )-2 i \operatorname {polylog}\left (2, {\mathrm e}^{i x}\right )\) | \(112\) |
Input:
int(x^2*cos(x)^2*cot(x)^2,x,method=_RETURNVERBOSE)
Output:
-1/2*x^3+1/16*I*(2*I*x+2*x^2-1)*exp(2*I*x)-1/16*I*(-2*I*x+2*x^2-1)*exp(-2* I*x)-2*I*x^2/(exp(2*I*x)-1)+2*x*ln(exp(I*x)+1)+2*x*ln(1-exp(I*x))-2*I*x^2- 2*I*polylog(2,-exp(I*x))-2*I*polylog(2,exp(I*x))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 162 vs. \(2 (62) = 124\).
Time = 0.09 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.95 \[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\frac {{\left (2 \, x^{2} - 1\right )} \cos \left (x\right )^{3} + 4 \, x \log \left (\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 4 \, x \log \left (\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 4 \, x \log \left (-\cos \left (x\right ) + i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) + 4 \, x \log \left (-\cos \left (x\right ) - i \, \sin \left (x\right ) + 1\right ) \sin \left (x\right ) - {\left (6 \, x^{2} - 1\right )} \cos \left (x\right ) - {\left (2 \, x^{3} + 2 \, x \cos \left (x\right )^{2} - x\right )} \sin \left (x\right ) - 4 i \, {\rm Li}_2\left (\cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 4 i \, {\rm Li}_2\left (\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right ) + 4 i \, {\rm Li}_2\left (-\cos \left (x\right ) + i \, \sin \left (x\right )\right ) \sin \left (x\right ) - 4 i \, {\rm Li}_2\left (-\cos \left (x\right ) - i \, \sin \left (x\right )\right ) \sin \left (x\right )}{4 \, \sin \left (x\right )} \] Input:
integrate(x^2*cos(x)^2*cot(x)^2,x, algorithm="fricas")
Output:
1/4*((2*x^2 - 1)*cos(x)^3 + 4*x*log(cos(x) + I*sin(x) + 1)*sin(x) + 4*x*lo g(cos(x) - I*sin(x) + 1)*sin(x) + 4*x*log(-cos(x) + I*sin(x) + 1)*sin(x) + 4*x*log(-cos(x) - I*sin(x) + 1)*sin(x) - (6*x^2 - 1)*cos(x) - (2*x^3 + 2* x*cos(x)^2 - x)*sin(x) - 4*I*dilog(cos(x) + I*sin(x))*sin(x) + 4*I*dilog(c os(x) - I*sin(x))*sin(x) + 4*I*dilog(-cos(x) + I*sin(x))*sin(x) - 4*I*dilo g(-cos(x) - I*sin(x))*sin(x))/sin(x)
\[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\int x^{2} \cos ^{2}{\left (x \right )} \cot ^{2}{\left (x \right )}\, dx \] Input:
integrate(x**2*cos(x)**2*cot(x)**2,x)
Output:
Integral(x**2*cos(x)**2*cot(x)**2, x)
Exception generated. \[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\text {Exception raised: RuntimeError} \] Input:
integrate(x^2*cos(x)^2*cot(x)^2,x, algorithm="maxima")
Output:
Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is un defined.
\[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\int { x^{2} \cos \left (x\right )^{2} \cot \left (x\right )^{2} \,d x } \] Input:
integrate(x^2*cos(x)^2*cot(x)^2,x, algorithm="giac")
Output:
integrate(x^2*cos(x)^2*cot(x)^2, x)
Timed out. \[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\int x^2\,{\cos \left (x\right )}^2\,{\mathrm {cot}\left (x\right )}^2 \,d x \] Input:
int(x^2*cos(x)^2*cot(x)^2,x)
Output:
int(x^2*cos(x)^2*cot(x)^2, x)
\[ \int x^2 \cos ^2(x) \cot ^2(x) \, dx=\int \cos \left (x \right )^{2} \cot \left (x \right )^{2} x^{2}d x \] Input:
int(x^2*cos(x)^2*cot(x)^2,x)
Output:
int(cos(x)**2*cot(x)**2*x**2,x)