\(\int \cot ^{-1}(c+d \cot (a+b x)) \, dx\) [173]

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

Optimal result

Integrand size = 11, antiderivative size = 198 \[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=x \cot ^{-1}(c+d \cot (a+b x))-\frac {1}{2} i x \log \left (1-\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )+\frac {1}{2} i x \log \left (1-\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )-\frac {\operatorname {PolyLog}\left (2,\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )}{4 b}+\frac {\operatorname {PolyLog}\left (2,\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )}{4 b} \]

[Out]

x*arccot(c+d*cot(b*x+a))-1/2*I*x*ln(1-(1+I*c-d)*exp(2*I*a+2*I*b*x)/(1+I*c+d))+1/2*I*x*ln(1-(c+I*(1+d))*exp(2*I
*a+2*I*b*x)/(c+I*(1-d)))-1/4*polylog(2,(1+I*c-d)*exp(2*I*a+2*I*b*x)/(1+I*c+d))/b+1/4*polylog(2,(c+I*(1+d))*exp
(2*I*a+2*I*b*x)/(c+I*(1-d)))/b

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 198, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {5278, 2221, 2317, 2438} \[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=-\frac {\operatorname {PolyLog}\left (2,\frac {(i c-d+1) e^{2 i a+2 i b x}}{i c+d+1}\right )}{4 b}+\frac {\operatorname {PolyLog}\left (2,\frac {(c+i (d+1)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )}{4 b}-\frac {1}{2} i x \log \left (1-\frac {(i c-d+1) e^{2 i a+2 i b x}}{i c+d+1}\right )+\frac {1}{2} i x \log \left (1-\frac {(c+i (d+1)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )+x \cot ^{-1}(d \cot (a+b x)+c) \]

[In]

Int[ArcCot[c + d*Cot[a + b*x]],x]

[Out]

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

Rule 2221

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

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[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]

Rule 2438

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]

Rule 5278

Int[ArcCot[(c_.) + Cot[(a_.) + (b_.)*(x_)]*(d_.)], x_Symbol] :> Simp[x*ArcCot[c + d*Cot[a + b*x]], x] + (-Dist
[b*(1 + I*c - d), Int[x*(E^(2*I*a + 2*I*b*x)/(1 + I*c + d - (1 + I*c - d)*E^(2*I*a + 2*I*b*x))), x], x] + Dist
[b*(1 - I*c + d), Int[x*(E^(2*I*a + 2*I*b*x)/(1 - I*c - d - (1 - I*c + d)*E^(2*I*a + 2*I*b*x))), x], x]) /; Fr
eeQ[{a, b, c, d}, x] && NeQ[(c - I*d)^2, -1]

Rubi steps \begin{align*} \text {integral}& = x \cot ^{-1}(c+d \cot (a+b x))-(b (1+i c-d)) \int \frac {e^{2 i a+2 i b x} x}{1+i c+d+(-1-i c+d) e^{2 i a+2 i b x}} \, dx+(b (1-i c+d)) \int \frac {e^{2 i a+2 i b x} x}{1-i c-d+(-1+i c-d) e^{2 i a+2 i b x}} \, dx \\ & = x \cot ^{-1}(c+d \cot (a+b x))-\frac {1}{2} i x \log \left (1-\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )+\frac {1}{2} i x \log \left (1-\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )-\frac {1}{2} i \int \log \left (1+\frac {(-1+i c-d) e^{2 i a+2 i b x}}{1-i c-d}\right ) \, dx+\frac {1}{2} i \int \log \left (1+\frac {(-1-i c+d) e^{2 i a+2 i b x}}{1+i c+d}\right ) \, dx \\ & = x \cot ^{-1}(c+d \cot (a+b x))-\frac {1}{2} i x \log \left (1-\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )+\frac {1}{2} i x \log \left (1-\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )-\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {(-1+i c-d) x}{1-i c-d}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b}+\frac {\text {Subst}\left (\int \frac {\log \left (1+\frac {(-1-i c+d) x}{1+i c+d}\right )}{x} \, dx,x,e^{2 i a+2 i b x}\right )}{4 b} \\ & = x \cot ^{-1}(c+d \cot (a+b x))-\frac {1}{2} i x \log \left (1-\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )+\frac {1}{2} i x \log \left (1-\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )-\frac {\operatorname {PolyLog}\left (2,\frac {(1+i c-d) e^{2 i a+2 i b x}}{1+i c+d}\right )}{4 b}+\frac {\operatorname {PolyLog}\left (2,\frac {(c+i (1+d)) e^{2 i a+2 i b x}}{c+i (1-d)}\right )}{4 b} \\ \end{align*}

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(1649\) vs. \(2(198)=396\).

Time = 12.13 (sec) , antiderivative size = 1649, normalized size of antiderivative = 8.33 \[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=x \cot ^{-1}(c+d \cot (a+b x))-\frac {d \left (4 a \sqrt {-d^2} \arctan \left (\frac {c d+\tan (a+b x)+c^2 \tan (a+b x)}{d}\right )+i d \log (1+i \tan (a+b x)) \log \left (\frac {c d-\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{i+i c^2+c d-\sqrt {-d^2}}\right )+i d \log (1-i \tan (a+b x)) \log \left (\frac {c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{-i-i c^2+c d+\sqrt {-d^2}}\right )-i d \log (1+i \tan (a+b x)) \log \left (\frac {c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{i+i c^2+c d+\sqrt {-d^2}}\right )-i d \log (1-i \tan (a+b x)) \log \left (\frac {-c d+\sqrt {-d^2}-\left (1+c^2\right ) \tan (a+b x)}{i+i c^2-c d+\sqrt {-d^2}}\right )-i d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2\right ) (1-i \tan (a+b x))}{1+c^2+i c d-i \sqrt {-d^2}}\right )+i d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2\right ) (1-i \tan (a+b x))}{1+c^2+i c d+i \sqrt {-d^2}}\right )-i d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2\right ) (1+i \tan (a+b x))}{1+c^2-i c d-i \sqrt {-d^2}}\right )+i d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2\right ) (1+i \tan (a+b x))}{1+c^2-i c d+i \sqrt {-d^2}}\right )\right ) \left (\frac {2 a}{b \left (-1-c^2-d^2+\cos (2 (a+b x))+c^2 \cos (2 (a+b x))-d^2 \cos (2 (a+b x))-2 c d \sin (2 (a+b x))\right )}-\frac {2 (a+b x)}{b \left (-1-c^2-d^2+\cos (2 (a+b x))+c^2 \cos (2 (a+b x))-d^2 \cos (2 (a+b x))-2 c d \sin (2 (a+b x))\right )}\right )}{\frac {d \log \left (1-\frac {\left (1+c^2\right ) (1-i \tan (a+b x))}{1+c^2+i c d-i \sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1-i \tan (a+b x)}-\frac {d \log \left (1-\frac {\left (1+c^2\right ) (1-i \tan (a+b x))}{1+c^2+i c d+i \sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1-i \tan (a+b x)}+\frac {d \log \left (\frac {c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{-i-i c^2+c d+\sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1-i \tan (a+b x)}-\frac {d \log \left (\frac {-c d+\sqrt {-d^2}-\left (1+c^2\right ) \tan (a+b x)}{i+i c^2-c d+\sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1-i \tan (a+b x)}-\frac {d \log \left (1-\frac {\left (1+c^2\right ) (1+i \tan (a+b x))}{1+c^2-i c d-i \sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1+i \tan (a+b x)}+\frac {d \log \left (1-\frac {\left (1+c^2\right ) (1+i \tan (a+b x))}{1+c^2-i c d+i \sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1+i \tan (a+b x)}-\frac {d \log \left (\frac {c d-\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{i+i c^2+c d-\sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1+i \tan (a+b x)}+\frac {d \log \left (\frac {c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}{i+i c^2+c d+\sqrt {-d^2}}\right ) \sec ^2(a+b x)}{1+i \tan (a+b x)}+\frac {i d \log (1+i \tan (a+b x)) \left (\sec ^2(a+b x)+c^2 \sec ^2(a+b x)\right )}{c d-\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}+\frac {i d \log (1-i \tan (a+b x)) \left (\sec ^2(a+b x)+c^2 \sec ^2(a+b x)\right )}{c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}-\frac {i d \log (1+i \tan (a+b x)) \left (\sec ^2(a+b x)+c^2 \sec ^2(a+b x)\right )}{c d+\sqrt {-d^2}+\tan (a+b x)+c^2 \tan (a+b x)}+\frac {i \left (1+c^2\right ) d \log (1-i \tan (a+b x)) \sec ^2(a+b x)}{-c d+\sqrt {-d^2}-\left (1+c^2\right ) \tan (a+b x)}+\frac {4 a \sqrt {-d^2} \left (\sec ^2(a+b x)+c^2 \sec ^2(a+b x)\right )}{d \left (1+\frac {\left (c d+\tan (a+b x)+c^2 \tan (a+b x)\right )^2}{d^2}\right )}} \]

[In]

Integrate[ArcCot[c + d*Cot[a + b*x]],x]

[Out]

x*ArcCot[c + d*Cot[a + b*x]] - (d*(4*a*Sqrt[-d^2]*ArcTan[(c*d + Tan[a + b*x] + c^2*Tan[a + b*x])/d] + I*d*Log[
1 + I*Tan[a + b*x]]*Log[(c*d - Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x])/(I + I*c^2 + c*d - Sqrt[-d^2])] +
 I*d*Log[1 - I*Tan[a + b*x]]*Log[(c*d + Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x])/(-I - I*c^2 + c*d + Sqrt
[-d^2])] - I*d*Log[1 + I*Tan[a + b*x]]*Log[(c*d + Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x])/(I + I*c^2 + c
*d + Sqrt[-d^2])] - I*d*Log[1 - I*Tan[a + b*x]]*Log[(-(c*d) + Sqrt[-d^2] - (1 + c^2)*Tan[a + b*x])/(I + I*c^2
- c*d + Sqrt[-d^2])] - I*d*PolyLog[2, ((1 + c^2)*(1 - I*Tan[a + b*x]))/(1 + c^2 + I*c*d - I*Sqrt[-d^2])] + I*d
*PolyLog[2, ((1 + c^2)*(1 - I*Tan[a + b*x]))/(1 + c^2 + I*c*d + I*Sqrt[-d^2])] - I*d*PolyLog[2, ((1 + c^2)*(1
+ I*Tan[a + b*x]))/(1 + c^2 - I*c*d - I*Sqrt[-d^2])] + I*d*PolyLog[2, ((1 + c^2)*(1 + I*Tan[a + b*x]))/(1 + c^
2 - I*c*d + I*Sqrt[-d^2])])*((2*a)/(b*(-1 - c^2 - d^2 + Cos[2*(a + b*x)] + c^2*Cos[2*(a + b*x)] - d^2*Cos[2*(a
 + b*x)] - 2*c*d*Sin[2*(a + b*x)])) - (2*(a + b*x))/(b*(-1 - c^2 - d^2 + Cos[2*(a + b*x)] + c^2*Cos[2*(a + b*x
)] - d^2*Cos[2*(a + b*x)] - 2*c*d*Sin[2*(a + b*x)]))))/((d*Log[1 - ((1 + c^2)*(1 - I*Tan[a + b*x]))/(1 + c^2 +
 I*c*d - I*Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 - I*Tan[a + b*x]) - (d*Log[1 - ((1 + c^2)*(1 - I*Tan[a + b*x]))/(1
+ c^2 + I*c*d + I*Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 - I*Tan[a + b*x]) + (d*Log[(c*d + Sqrt[-d^2] + Tan[a + b*x]
+ c^2*Tan[a + b*x])/(-I - I*c^2 + c*d + Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 - I*Tan[a + b*x]) - (d*Log[(-(c*d) + S
qrt[-d^2] - (1 + c^2)*Tan[a + b*x])/(I + I*c^2 - c*d + Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 - I*Tan[a + b*x]) - (d*
Log[1 - ((1 + c^2)*(1 + I*Tan[a + b*x]))/(1 + c^2 - I*c*d - I*Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 + I*Tan[a + b*x]
) + (d*Log[1 - ((1 + c^2)*(1 + I*Tan[a + b*x]))/(1 + c^2 - I*c*d + I*Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 + I*Tan[a
 + b*x]) - (d*Log[(c*d - Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x])/(I + I*c^2 + c*d - Sqrt[-d^2])]*Sec[a +
 b*x]^2)/(1 + I*Tan[a + b*x]) + (d*Log[(c*d + Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x])/(I + I*c^2 + c*d +
 Sqrt[-d^2])]*Sec[a + b*x]^2)/(1 + I*Tan[a + b*x]) + (I*d*Log[1 + I*Tan[a + b*x]]*(Sec[a + b*x]^2 + c^2*Sec[a
+ b*x]^2))/(c*d - Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x]) + (I*d*Log[1 - I*Tan[a + b*x]]*(Sec[a + b*x]^2
 + c^2*Sec[a + b*x]^2))/(c*d + Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x]) - (I*d*Log[1 + I*Tan[a + b*x]]*(S
ec[a + b*x]^2 + c^2*Sec[a + b*x]^2))/(c*d + Sqrt[-d^2] + Tan[a + b*x] + c^2*Tan[a + b*x]) + (I*(1 + c^2)*d*Log
[1 - I*Tan[a + b*x]]*Sec[a + b*x]^2)/(-(c*d) + Sqrt[-d^2] - (1 + c^2)*Tan[a + b*x]) + (4*a*Sqrt[-d^2]*(Sec[a +
 b*x]^2 + c^2*Sec[a + b*x]^2))/(d*(1 + (c*d + Tan[a + b*x] + c^2*Tan[a + b*x])^2/d^2)))

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1145 vs. \(2 (168 ) = 336\).

Time = 4.58 (sec) , antiderivative size = 1146, normalized size of antiderivative = 5.79

method result size
derivativedivides \(\text {Expression too large to display}\) \(1146\)
default \(\text {Expression too large to display}\) \(1146\)
risch \(\text {Expression too large to display}\) \(4982\)

[In]

int(arccot(c+d*cot(b*x+a)),x,method=_RETURNVERBOSE)

[Out]

1/b/d*(-d*(1/2*Pi-arccot(cot(b*x+a)))*arccot(c+d*cot(b*x+a))-d^2*(-1/d*arctan(d*((c+d*cot(b*x+a))/d-c/d)+c)*ar
ctan(-(c+d*cot(b*x+a))/d+c/d)-1/d^2*(1/2*I*d^2*ln(1-(c-I*d+I)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d
*cot(b*x+a))/d-c/d)+c)^2+1)/(I*d+I-c))*arctan(d*((c+d*cot(b*x+a))/d-c/d)+c)/(1+I*c+d)+1/2*I*d*ln(1-(c-I*d+I)*(
1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d*cot(b*x+a))/d-c/d)+c)^2+1)/(I*d+I-c))*arctan(d*((c+d*cot(b*x+a
))/d-c/d)+c)/(1+I*c+d)+1/2*I*d/(c-I*d-I)*ln(1-(c-I*d+I)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d*cot(b
*x+a))/d-c/d)+c)^2+1)/(I*d+I-c))*c*arctan(d*((c+d*cot(b*x+a))/d-c/d)+c)+1/2*d^2*arctan(d*((c+d*cot(b*x+a))/d-c
/d)+c)^2/(1+I*c+d)+1/4*d^2*polylog(2,(c-I*d+I)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d*cot(b*x+a))/d-
c/d)+c)^2+1)/(I*d+I-c))/(1+I*c+d)+1/2*d*arctan(d*((c+d*cot(b*x+a))/d-c/d)+c)^2/(1+I*c+d)+1/2*d/(c-I*d-I)*c*arc
tan(d*((c+d*cot(b*x+a))/d-c/d)+c)^2+1/4*d*polylog(2,(c-I*d+I)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d
*cot(b*x+a))/d-c/d)+c)^2+1)/(I*d+I-c))/(1+I*c+d)+1/4*d/(c-I*d-I)*polylog(2,(c-I*d+I)*(1+I*(d*((c+d*cot(b*x+a))
/d-c/d)+c))^2/((d*((c+d*cot(b*x+a))/d-c/d)+c)^2+1)/(I*d+I-c))*c-1/2*I*d*arctan(d*((c+d*cot(b*x+a))/d-c/d)+c)*l
n(1-(I+c+I*d)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+d*cot(b*x+a))/d-c/d)+c)^2+1)/(-I*d+I-c))-1/2*d*ar
ctan(d*((c+d*cot(b*x+a))/d-c/d)+c)^2-1/4*d*polylog(2,(I+c+I*d)*(1+I*(d*((c+d*cot(b*x+a))/d-c/d)+c))^2/((d*((c+
d*cot(b*x+a))/d-c/d)+c)^2+1)/(-I*d+I-c)))))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 965 vs. \(2 (140) = 280\).

Time = 0.40 (sec) , antiderivative size = 965, normalized size of antiderivative = 4.87 \[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=\text {Too large to display} \]

[In]

integrate(arccot(c+d*cot(b*x+a)),x, algorithm="fricas")

[Out]

1/8*(8*b*x*arccot(d*cot(b*x + a) + c) + 2*I*a*log(1/2*c^2 + I*c*d - 1/2*d^2 - 1/2*(c^2 + d^2 + 2*d + 1)*cos(2*
b*x + 2*a) + 1/2*(I*c^2 + I*d^2 + 2*I*d + I)*sin(2*b*x + 2*a) + 1/2) - 2*I*a*log(1/2*c^2 + I*c*d - 1/2*d^2 - 1
/2*(c^2 + d^2 - 2*d + 1)*cos(2*b*x + 2*a) + 1/2*(I*c^2 + I*d^2 - 2*I*d + I)*sin(2*b*x + 2*a) + 1/2) - 2*I*a*lo
g(-1/2*c^2 + I*c*d + 1/2*d^2 + 1/2*(c^2 + d^2 + 2*d + 1)*cos(2*b*x + 2*a) + 1/2*(I*c^2 + I*d^2 + 2*I*d + I)*si
n(2*b*x + 2*a) - 1/2) + 2*I*a*log(-1/2*c^2 + I*c*d + 1/2*d^2 + 1/2*(c^2 + d^2 - 2*d + 1)*cos(2*b*x + 2*a) + 1/
2*(I*c^2 + I*d^2 - 2*I*d + I)*sin(2*b*x + 2*a) - 1/2) - 2*(I*b*x + I*a)*log((c^2 + d^2 - (c^2 + 2*I*c*d - d^2
+ 1)*cos(2*b*x + 2*a) + (-I*c^2 + 2*c*d + I*d^2 - I)*sin(2*b*x + 2*a) + 2*d + 1)/(c^2 + d^2 + 2*d + 1)) - 2*(-
I*b*x - I*a)*log((c^2 + d^2 - (c^2 - 2*I*c*d - d^2 + 1)*cos(2*b*x + 2*a) + (I*c^2 + 2*c*d - I*d^2 + I)*sin(2*b
*x + 2*a) + 2*d + 1)/(c^2 + d^2 + 2*d + 1)) - 2*(-I*b*x - I*a)*log((c^2 + d^2 - (c^2 + 2*I*c*d - d^2 + 1)*cos(
2*b*x + 2*a) + (-I*c^2 + 2*c*d + I*d^2 - I)*sin(2*b*x + 2*a) - 2*d + 1)/(c^2 + d^2 - 2*d + 1)) - 2*(I*b*x + I*
a)*log((c^2 + d^2 - (c^2 - 2*I*c*d - d^2 + 1)*cos(2*b*x + 2*a) + (I*c^2 + 2*c*d - I*d^2 + I)*sin(2*b*x + 2*a)
- 2*d + 1)/(c^2 + d^2 - 2*d + 1)) - dilog(-(c^2 + d^2 - (c^2 + 2*I*c*d - d^2 + 1)*cos(2*b*x + 2*a) + (-I*c^2 +
 2*c*d + I*d^2 - I)*sin(2*b*x + 2*a) + 2*d + 1)/(c^2 + d^2 + 2*d + 1) + 1) - dilog(-(c^2 + d^2 - (c^2 - 2*I*c*
d - d^2 + 1)*cos(2*b*x + 2*a) + (I*c^2 + 2*c*d - I*d^2 + I)*sin(2*b*x + 2*a) + 2*d + 1)/(c^2 + d^2 + 2*d + 1)
+ 1) + dilog(-(c^2 + d^2 - (c^2 + 2*I*c*d - d^2 + 1)*cos(2*b*x + 2*a) + (-I*c^2 + 2*c*d + I*d^2 - I)*sin(2*b*x
 + 2*a) - 2*d + 1)/(c^2 + d^2 - 2*d + 1) + 1) + dilog(-(c^2 + d^2 - (c^2 - 2*I*c*d - d^2 + 1)*cos(2*b*x + 2*a)
 + (I*c^2 + 2*c*d - I*d^2 + I)*sin(2*b*x + 2*a) - 2*d + 1)/(c^2 + d^2 - 2*d + 1) + 1))/b

Sympy [F]

\[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=\int \operatorname {acot}{\left (c + d \cot {\left (a + b x \right )} \right )}\, dx \]

[In]

integrate(acot(c+d*cot(b*x+a)),x)

[Out]

Integral(acot(c + d*cot(a + b*x)), x)

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 532 vs. \(2 (140) = 280\).

Time = 0.35 (sec) , antiderivative size = 532, normalized size of antiderivative = 2.69 \[ \int \cot ^{-1}(c+d \cot (a+b x)) \, dx=\frac {d {\left (\frac {8 \, {\left (b x + a\right )} \arctan \left (\frac {c d + {\left (c^{2} + 1\right )} \tan \left (b x + a\right )}{d}\right )}{d} - \frac {8 \, {\left (b x + a\right )} \arctan \left (\frac {c d + {\left (c^{2} + 1\right )} \tan \left (b x + a\right )}{d}\right ) - 4 \, \arctan \left (\frac {c d + {\left (c^{2} + 1\right )} \tan \left (b x + a\right )}{d}\right ) \arctan \left (\frac {c d + {\left (c^{2} + d + 1\right )} \tan \left (b x + a\right )}{c^{2} + d^{2} + 2 \, d + 1}, -\frac {c d \tan \left (b x + a\right ) - c^{2} - d - 1}{c^{2} + d^{2} + 2 \, d + 1}\right ) + 4 \, \arctan \left (\frac {c d + {\left (c^{2} + 1\right )} \tan \left (b x + a\right )}{d}\right ) \arctan \left (-\frac {c d + {\left (c^{2} - d + 1\right )} \tan \left (b x + a\right )}{c^{2} + d^{2} - 2 \, d + 1}, -\frac {c d \tan \left (b x + a\right ) - c^{2} + d - 1}{c^{2} + d^{2} - 2 \, d + 1}\right ) - {\left (\log \left (\frac {{\left (c^{2} + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + 1}{c^{2} + d^{2} + 2 \, d + 1}\right ) - \log \left (\frac {{\left (c^{2} + 1\right )} \tan \left (b x + a\right )^{2} + c^{2} + 1}{c^{2} + d^{2} - 2 \, d + 1}\right )\right )} \log \left ({\left (c^{2} + 1\right )} d^{2} + 2 \, {\left (c^{3} + c\right )} d \tan \left (b x + a\right ) + {\left (c^{4} + 2 \, c^{2} + 1\right )} \tan \left (b x + a\right )^{2}\right ) - 2 \, {\rm Li}_2\left (\frac {{\left (i \, c - 1\right )} \tan \left (b x + a\right ) + i \, d}{c + i \, d + i}\right ) + 2 \, {\rm Li}_2\left (\frac {{\left (i \, c + 1\right )} \tan \left (b x + a\right ) + i \, d}{c + i \, d - i}\right ) + 2 \, {\rm Li}_2\left (-\frac {{\left (i \, c - 1\right )} \tan \left (b x + a\right ) + i \, d}{c - i \, d + i}\right ) - 2 \, {\rm Li}_2\left (-\frac {{\left (i \, c + 1\right )} \tan \left (b x + a\right ) + i \, d}{c - i \, d - i}\right )}{d}\right )} + 8 \, {\left (b x + a\right )} \operatorname {arccot}\left (c + \frac {d}{\tan \left (b x + a\right )}\right ) - 8 \, {\left (b x + a\right )} \arctan \left (\frac {c d + {\left (c^{2} + 1\right )} \tan \left (b x + a\right )}{d}\right )}{8 \, b} \]

[In]

integrate(arccot(c+d*cot(b*x+a)),x, algorithm="maxima")

[Out]

1/8*(d*(8*(b*x + a)*arctan((c*d + (c^2 + 1)*tan(b*x + a))/d)/d - (8*(b*x + a)*arctan((c*d + (c^2 + 1)*tan(b*x
+ a))/d) - 4*arctan((c*d + (c^2 + 1)*tan(b*x + a))/d)*arctan2((c*d + (c^2 + d + 1)*tan(b*x + a))/(c^2 + d^2 +
2*d + 1), -(c*d*tan(b*x + a) - c^2 - d - 1)/(c^2 + d^2 + 2*d + 1)) + 4*arctan((c*d + (c^2 + 1)*tan(b*x + a))/d
)*arctan2(-(c*d + (c^2 - d + 1)*tan(b*x + a))/(c^2 + d^2 - 2*d + 1), -(c*d*tan(b*x + a) - c^2 + d - 1)/(c^2 +
d^2 - 2*d + 1)) - (log(((c^2 + 1)*tan(b*x + a)^2 + c^2 + 1)/(c^2 + d^2 + 2*d + 1)) - log(((c^2 + 1)*tan(b*x +
a)^2 + c^2 + 1)/(c^2 + d^2 - 2*d + 1)))*log((c^2 + 1)*d^2 + 2*(c^3 + c)*d*tan(b*x + a) + (c^4 + 2*c^2 + 1)*tan
(b*x + a)^2) - 2*dilog(((I*c - 1)*tan(b*x + a) + I*d)/(c + I*d + I)) + 2*dilog(((I*c + 1)*tan(b*x + a) + I*d)/
(c + I*d - I)) + 2*dilog(-((I*c - 1)*tan(b*x + a) + I*d)/(c - I*d + I)) - 2*dilog(-((I*c + 1)*tan(b*x + a) + I
*d)/(c - I*d - I)))/d) + 8*(b*x + a)*arccot(c + d/tan(b*x + a)) - 8*(b*x + a)*arctan((c*d + (c^2 + 1)*tan(b*x
+ a))/d))/b

Giac [F]

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

[In]

integrate(arccot(c+d*cot(b*x+a)),x, algorithm="giac")

[Out]

integrate(arccot(d*cot(b*x + a) + c), x)

Mupad [F(-1)]

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

[In]

int(acot(c + d*cot(a + b*x)),x)

[Out]

int(acot(c + d*cot(a + b*x)), x)