\(\int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx\) [27]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [A] (verification not implemented)
Sympy [F(-2)]
Maxima [F(-2)]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 21, antiderivative size = 154 \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=-\frac {b x^4}{12}+\frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{6} i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )-\frac {x^2 \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{4 b}-\frac {i x \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )}{4 b^2}+\frac {\operatorname {PolyLog}\left (4,i c e^{2 i a+2 i b x}\right )}{8 b^3} \] Output:

-1/12*b*x^4+1/3*x^3*(Pi-arccot(-c-(1-I*c)*cot(b*x+a)))-1/6*I*x^3*ln(1-I*c* 
exp(2*I*a+2*I*b*x))-1/4*x^2*polylog(2,I*c*exp(2*I*a+2*I*b*x))/b-1/4*I*x*po 
lylog(3,I*c*exp(2*I*a+2*I*b*x))/b^2+1/8*polylog(4,I*c*exp(2*I*a+2*I*b*x))/ 
b^3
 

Mathematica [A] (verified)

Time = 0.15 (sec) , antiderivative size = 140, normalized size of antiderivative = 0.91 \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=\frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {4 i b^3 x^3 \log \left (1+\frac {i e^{-2 i (a+b x)}}{c}\right )-6 b^2 x^2 \operatorname {PolyLog}\left (2,-\frac {i e^{-2 i (a+b x)}}{c}\right )+6 i b x \operatorname {PolyLog}\left (3,-\frac {i e^{-2 i (a+b x)}}{c}\right )+3 \operatorname {PolyLog}\left (4,-\frac {i e^{-2 i (a+b x)}}{c}\right )}{24 b^3} \] Input:

Integrate[x^2*ArcCot[c + (1 - I*c)*Cot[a + b*x]],x]
 

Output:

(x^3*ArcCot[c + (1 - I*c)*Cot[a + b*x]])/3 - ((4*I)*b^3*x^3*Log[1 + I/(c*E 
^((2*I)*(a + b*x)))] - 6*b^2*x^2*PolyLog[2, (-I)/(c*E^((2*I)*(a + b*x)))] 
+ (6*I)*b*x*PolyLog[3, (-I)/(c*E^((2*I)*(a + b*x)))] + 3*PolyLog[4, (-I)/( 
c*E^((2*I)*(a + b*x)))])/(24*b^3)
 

Rubi [A] (verified)

Time = 0.78 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.29, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {5697, 25, 2615, 2620, 3011, 7163, 2720, 7143}

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 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx\)

\(\Big \downarrow \) 5697

\(\displaystyle \frac {1}{3} i b \int -\frac {x^3}{e^{2 i a+2 i b x} c+i}dx+\frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \int \frac {x^3}{e^{2 i a+2 i b x} c+i}dx\)

\(\Big \downarrow \) 2615

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \int \frac {e^{2 i a+2 i b x} x^3}{e^{2 i a+2 i b x} c+i}dx-\frac {i x^4}{4}\right )\)

\(\Big \downarrow \) 2620

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \left (\frac {3 i \int x^2 \log \left (1-i c e^{2 i a+2 i b x}\right )dx}{2 b c}-\frac {i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )}{2 b c}\right )-\frac {i x^4}{4}\right )\)

\(\Big \downarrow \) 3011

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \left (\frac {3 i \left (\frac {i x^2 \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{2 b}-\frac {i \int x \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )dx}{b}\right )}{2 b c}-\frac {i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )}{2 b c}\right )-\frac {i x^4}{4}\right )\)

\(\Big \downarrow \) 7163

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \left (\frac {3 i \left (\frac {i x^2 \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{2 b}-\frac {i \left (\frac {i \int \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )dx}{2 b}-\frac {i x \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )}{2 b}\right )}{b}\right )}{2 b c}-\frac {i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )}{2 b c}\right )-\frac {i x^4}{4}\right )\)

\(\Big \downarrow \) 2720

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \left (\frac {3 i \left (\frac {i x^2 \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{2 b}-\frac {i \left (\frac {\int e^{-2 i a-2 i b x} \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )de^{2 i a+2 i b x}}{4 b^2}-\frac {i x \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )}{2 b}\right )}{b}\right )}{2 b c}-\frac {i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )}{2 b c}\right )-\frac {i x^4}{4}\right )\)

\(\Big \downarrow \) 7143

\(\displaystyle \frac {1}{3} x^3 \cot ^{-1}(c+(1-i c) \cot (a+b x))-\frac {1}{3} i b \left (i c \left (\frac {3 i \left (\frac {i x^2 \operatorname {PolyLog}\left (2,i c e^{2 i a+2 i b x}\right )}{2 b}-\frac {i \left (\frac {\operatorname {PolyLog}\left (4,i c e^{2 i a+2 i b x}\right )}{4 b^2}-\frac {i x \operatorname {PolyLog}\left (3,i c e^{2 i a+2 i b x}\right )}{2 b}\right )}{b}\right )}{2 b c}-\frac {i x^3 \log \left (1-i c e^{2 i a+2 i b x}\right )}{2 b c}\right )-\frac {i x^4}{4}\right )\)

Input:

Int[x^2*ArcCot[c + (1 - I*c)*Cot[a + b*x]],x]
 

Output:

(x^3*ArcCot[c + (1 - I*c)*Cot[a + b*x]])/3 - (I/3)*b*((-1/4*I)*x^4 + I*c*( 
((-1/2*I)*x^3*Log[1 - I*c*E^((2*I)*a + (2*I)*b*x)])/(b*c) + (((3*I)/2)*((( 
I/2)*x^2*PolyLog[2, I*c*E^((2*I)*a + (2*I)*b*x)])/b - (I*(((-1/2*I)*x*Poly 
Log[3, I*c*E^((2*I)*a + (2*I)*b*x)])/b + PolyLog[4, I*c*E^((2*I)*a + (2*I) 
*b*x)]/(4*b^2)))/b))/(b*c)))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2615
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x 
_))))^(n_.)), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(a*d*(m + 1)), x] - Simp[ 
b/a   Int[(c + d*x)^m*((F^(g*(e + f*x)))^n/(a + b*(F^(g*(e + f*x)))^n)), x] 
, x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2620
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]
 

rule 2720
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] 
   Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct 
ionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ 
[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) 
*(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
 

rule 3011
Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.) 
*(x_))^(m_.), x_Symbol] :> Simp[(-(f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + 
b*x)))^n]/(b*c*n*Log[F])), x] + Simp[g*(m/(b*c*n*Log[F]))   Int[(f + g*x)^( 
m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e 
, f, g, n}, x] && GtQ[m, 0]
 

rule 5697
Int[ArcCot[(c_.) + Cot[(a_.) + (b_.)*(x_)]*(d_.)]*((e_.) + (f_.)*(x_))^(m_. 
), x_Symbol] :> Simp[(e + f*x)^(m + 1)*(ArcCot[c + d*Cot[a + b*x]]/(f*(m + 
1))), x] + Simp[I*(b/(f*(m + 1)))   Int[(e + f*x)^(m + 1)/(c - I*d - c*E^(2 
*I*a + 2*I*b*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && E 
qQ[(c - I*d)^2, -1]
 

rule 7143
Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_S 
ymbol] :> Simp[PolyLog[n + 1, c*(a + b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d 
, e, n, p}, x] && EqQ[b*d, a*e]
 

rule 7163
Int[((e_.) + (f_.)*(x_))^(m_.)*PolyLog[n_, (d_.)*((F_)^((c_.)*((a_.) + (b_. 
)*(x_))))^(p_.)], x_Symbol] :> Simp[(e + f*x)^m*(PolyLog[n + 1, d*(F^(c*(a 
+ b*x)))^p]/(b*c*p*Log[F])), x] - Simp[f*(m/(b*c*p*Log[F]))   Int[(e + f*x) 
^(m - 1)*PolyLog[n + 1, d*(F^(c*(a + b*x)))^p], x], x] /; FreeQ[{F, a, b, c 
, d, e, f, n, p}, x] && GtQ[m, 0]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 4.38 (sec) , antiderivative size = 1448, normalized size of antiderivative = 9.40

method result size
risch \(\text {Expression too large to display}\) \(1448\)

Input:

int(x^2*(Pi-arccot(-c-(1-I*c)*cot(b*x+a))),x,method=_RETURNVERBOSE)
 

Output:

1/2*I/b^2*ln(1-I*exp(2*I*(b*x+a))*c)*x*a^2-1/12*(Pi*csgn(I*exp(I*(b*x+a))) 
^2*csgn(I*exp(2*I*(b*x+a)))-2*Pi*csgn(I*exp(I*(b*x+a)))*csgn(I*exp(2*I*(b* 
x+a)))^2+Pi*csgn(I*exp(2*I*(b*x+a)))^3+Pi*csgn(I*exp(2*I*(b*x+a)))*csgn(I* 
(I+c)/(exp(2*I*(b*x+a))-1))*csgn(I*exp(2*I*(b*x+a))*(I+c)/(exp(2*I*(b*x+a) 
)-1))-Pi*csgn(I*exp(2*I*(b*x+a)))*csgn(I*exp(2*I*(b*x+a))*(I+c)/(exp(2*I*( 
b*x+a))-1))^2+Pi*csgn(I*exp(2*I*(b*x+a))*(I+c)/(exp(2*I*(b*x+a))-1))*csgn( 
exp(2*I*(b*x+a))*(I+c)/(exp(2*I*(b*x+a))-1))-Pi*csgn(exp(2*I*(b*x+a))*(I+c 
)/(exp(2*I*(b*x+a))-1))^2-Pi*csgn(I*(exp(2*I*(b*x+a))*c+I))*csgn(I/(exp(2* 
I*(b*x+a))-1))*csgn(I*(exp(2*I*(b*x+a))*c+I)/(exp(2*I*(b*x+a))-1))+Pi*csgn 
(I*(exp(2*I*(b*x+a))*c+I))*csgn(I*(exp(2*I*(b*x+a))*c+I)/(exp(2*I*(b*x+a)) 
-1))^2-Pi*csgn(I*(exp(2*I*(b*x+a))*c+I)/(exp(2*I*(b*x+a))-1))*csgn((exp(2* 
I*(b*x+a))*c+I)/(exp(2*I*(b*x+a))-1))-Pi*csgn((exp(2*I*(b*x+a))*c+I)/(exp( 
2*I*(b*x+a))-1))^2+Pi*csgn(I*(I+c))*csgn(I/(exp(2*I*(b*x+a))-1))*csgn(I*(I 
+c)/(exp(2*I*(b*x+a))-1))-Pi*csgn(I*(I+c))*csgn(I*(I+c)/(exp(2*I*(b*x+a))- 
1))^2-Pi*csgn(I/(exp(2*I*(b*x+a))-1))*csgn(I*(I+c)/(exp(2*I*(b*x+a))-1))^2 
+Pi*csgn(I/(exp(2*I*(b*x+a))-1))*csgn(I*(exp(2*I*(b*x+a))*c+I)/(exp(2*I*(b 
*x+a))-1))^2+Pi*csgn(I*(I+c)/(exp(2*I*(b*x+a))-1))^3-Pi*csgn(I*(I+c)/(exp( 
2*I*(b*x+a))-1))*csgn(I*exp(2*I*(b*x+a))*(I+c)/(exp(2*I*(b*x+a))-1))^2-Pi* 
csgn(I*(exp(2*I*(b*x+a))*c+I)/(exp(2*I*(b*x+a))-1))^3+Pi*csgn(I*(exp(2*I*( 
b*x+a))*c+I)/(exp(2*I*(b*x+a))-1))*csgn((exp(2*I*(b*x+a))*c+I)/(exp(2*I...
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.13 \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=-\frac {2 \, b^{4} x^{4} - 8 \, \pi b^{3} x^{3} - 4 i \, b^{3} x^{3} \log \left (\frac {{\left (c e^{\left (2 i \, b x + 2 i \, a\right )} + i\right )} e^{\left (-2 i \, b x - 2 i \, a\right )}}{c + i}\right ) + 6 \, b^{2} x^{2} {\rm Li}_2\left (i \, c e^{\left (2 i \, b x + 2 i \, a\right )}\right ) - 2 \, a^{4} - 4 i \, a^{3} \log \left (\frac {c e^{\left (2 i \, b x + 2 i \, a\right )} + i}{c}\right ) + 6 i \, b x {\rm polylog}\left (3, i \, c e^{\left (2 i \, b x + 2 i \, a\right )}\right ) + 4 \, {\left (i \, b^{3} x^{3} + i \, a^{3}\right )} \log \left (-i \, c e^{\left (2 i \, b x + 2 i \, a\right )} + 1\right ) - 3 \, {\rm polylog}\left (4, i \, c e^{\left (2 i \, b x + 2 i \, a\right )}\right )}{24 \, b^{3}} \] Input:

integrate(x^2*(pi-arccot(-c-(1-I*c)*cot(b*x+a))),x, algorithm="fricas")
 

Output:

-1/24*(2*b^4*x^4 - 8*pi*b^3*x^3 - 4*I*b^3*x^3*log((c*e^(2*I*b*x + 2*I*a) + 
 I)*e^(-2*I*b*x - 2*I*a)/(c + I)) + 6*b^2*x^2*dilog(I*c*e^(2*I*b*x + 2*I*a 
)) - 2*a^4 - 4*I*a^3*log((c*e^(2*I*b*x + 2*I*a) + I)/c) + 6*I*b*x*polylog( 
3, I*c*e^(2*I*b*x + 2*I*a)) + 4*(I*b^3*x^3 + I*a^3)*log(-I*c*e^(2*I*b*x + 
2*I*a) + 1) - 3*polylog(4, I*c*e^(2*I*b*x + 2*I*a)))/b^3
 

Sympy [F(-2)]

Exception generated. \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=\text {Exception raised: CoercionFailed} \] Input:

integrate(x**2*(pi-acot(-c-(1-I*c)*cot(b*x+a))),x)
 

Output:

Exception raised: CoercionFailed >> Cannot convert 2*_t0**4*c**2*exp(4*I*a 
) + _t0**4*I*c*exp(4*I*a) + 3*_t0**2*I*c*exp(2*I*a) - _t0**2*exp(2*I*a) - 
1 of type <class 'sympy.core.add.Add'> to QQ_I[x,b,c,_t0,exp(I*a)]
 

Maxima [F(-2)]

Exception generated. \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=\text {Exception raised: ValueError} \] Input:

integrate(x^2*(pi-arccot(-c-(1-I*c)*cot(b*x+a))),x, algorithm="maxima")
 

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(c-1>0)', see `assume?` for more 
details)Is
 

Giac [F]

\[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=\int { {\left (\pi - \operatorname {arccot}\left (-{\left (-i \, c + 1\right )} \cot \left (b x + a\right ) - c\right )\right )} x^{2} \,d x } \] Input:

integrate(x^2*(pi-arccot(-c-(1-I*c)*cot(b*x+a))),x, algorithm="giac")
 

Output:

integrate((pi - arccot(-(-I*c + 1)*cot(b*x + a) - c))*x^2, x)
 

Mupad [F(-1)]

Timed out. \[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=\int x^2\,\left (\Pi +\mathrm {acot}\left (c-\mathrm {cot}\left (a+b\,x\right )\,\left (-1+c\,1{}\mathrm {i}\right )\right )\right ) \,d x \] Input:

int(x^2*(Pi + acot(c - cot(a + b*x)*(c*1i - 1))),x)
                                                                                    
                                                                                    
 

Output:

int(x^2*(Pi + acot(c - cot(a + b*x)*(c*1i - 1))), x)
 

Reduce [F]

\[ \int x^2 \cot ^{-1}(c+(1-i c) \cot (a+b x)) \, dx=-\left (\int \mathit {acot} \left (\cot \left (b x +a \right ) c i -\cot \left (b x +a \right )-c \right ) x^{2}d x \right )+\frac {\pi \,x^{3}}{3} \] Input:

int(x^2*(Pi-acot(-c-(1-I*c)*cot(b*x+a))),x)
 

Output:

( - 3*int(acot(cot(a + b*x)*c*i - cot(a + b*x) - c)*x**2,x) + pi*x**3)/3