\(\int \arctan (c+(i+c) \coth (a+b x)) \, dx\) [104]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [B] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-2)]
Maxima [A] (verification not implemented)
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 15, antiderivative size = 79 \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=-\frac {1}{2} i b x^2+x \arctan (c+(i+c) \coth (a+b x))+\frac {1}{2} i x \log \left (1-i c e^{2 a+2 b x}\right )+\frac {i \operatorname {PolyLog}\left (2,i c e^{2 a+2 b x}\right )}{4 b} \] Output:

-1/2*I*b*x^2+x*arctan(c+(I+c)*coth(b*x+a))+1/2*I*x*ln(1-I*c*exp(2*b*x+2*a) 
)+1/4*I*polylog(2,I*c*exp(2*b*x+2*a))/b
 

Mathematica [A] (verified)

Time = 1.29 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.90 \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=x \arctan (c+(i+c) \coth (a+b x))+\frac {i \left (2 b x \log \left (1+\frac {i e^{-2 (a+b x)}}{c}\right )-\operatorname {PolyLog}\left (2,-\frac {i e^{-2 (a+b x)}}{c}\right )\right )}{4 b} \] Input:

Integrate[ArcTan[c + (I + c)*Coth[a + b*x]],x]
 

Output:

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

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.16, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {5712, 25, 2615, 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 \arctan (c+(c+i) \coth (a+b x)) \, dx\)

\(\Big \downarrow \) 5712

\(\displaystyle x \arctan (c+(c+i) \coth (a+b x))-b \int -\frac {x}{e^{2 a+2 b x} c+i}dx\)

\(\Big \downarrow \) 25

\(\displaystyle b \int \frac {x}{e^{2 a+2 b x} c+i}dx+x \arctan (c+(c+i) \coth (a+b x))\)

\(\Big \downarrow \) 2615

\(\displaystyle b \left (i c \int \frac {e^{2 a+2 b x} x}{e^{2 a+2 b x} c+i}dx-\frac {i x^2}{2}\right )+x \arctan (c+(c+i) \coth (a+b x))\)

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

\(\displaystyle b \left (i c \left (\frac {x \log \left (1-i c e^{2 a+2 b x}\right )}{2 b c}-\frac {\int e^{-2 a-2 b x} \log \left (1-i c e^{2 a+2 b x}\right )de^{2 a+2 b x}}{4 b^2 c}\right )-\frac {i x^2}{2}\right )+x \arctan (c+(c+i) \coth (a+b x))\)

\(\Big \downarrow \) 2838

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

Input:

Int[ArcTan[c + (I + c)*Coth[a + b*x]],x]
 

Output:

x*ArcTan[c + (I + c)*Coth[a + b*x]] + b*((-1/2*I)*x^2 + I*c*((x*Log[1 - I* 
c*E^(2*a + 2*b*x)])/(2*b*c) + PolyLog[2, I*c*E^(2*a + 2*b*x)]/(4*b^2*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 2715
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]
 

rule 2838
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 5712
Int[ArcTan[(c_.) + Coth[(a_.) + (b_.)*(x_)]*(d_.)], x_Symbol] :> Simp[x*Arc 
Tan[c + d*Coth[a + b*x]], x] - Simp[b   Int[x/(c - d - c*E^(2*a + 2*b*x)), 
x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[(c - d)^2, -1]
 
Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 544 vs. \(2 (65 ) = 130\).

Time = 0.62 (sec) , antiderivative size = 545, normalized size of antiderivative = 6.90

method result size
derivativedivides \(\frac {-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c^{2}}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}-\left (i+c \right )^{2} \left (\frac {-\frac {i \left (\left (\ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )-\ln \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )-\operatorname {dilog}\left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )\right )}{2}+\frac {i \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )^{2}}{4}}{2 i+2 c}-\frac {-\frac {i \left (\operatorname {dilog}\left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )+\ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) \ln \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )\right )}{2}+\frac {i \left (\operatorname {dilog}\left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )+\ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) \ln \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )\right )}{2}}{2 \left (i+c \right )}\right )}{b \left (i+c \right )}\) \(545\)
default \(\frac {-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2 i+2 c}+\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right ) c^{2}}{2 i+2 c}+\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right )}{2 i+2 c}-\frac {2 i \arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c}{2 i+2 c}-\frac {\arctan \left (c +\left (i+c \right ) \coth \left (b x +a \right )\right ) \ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) c^{2}}{2 i+2 c}-\left (i+c \right )^{2} \left (\frac {-\frac {i \left (\left (\ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )-\ln \left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )\right ) \ln \left (-\frac {i \left (i-c -\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )-\operatorname {dilog}\left (-\frac {i \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )}{2}\right )\right )}{2}+\frac {i \ln \left (i+c +\left (i+c \right ) \coth \left (b x +a \right )\right )^{2}}{4}}{2 i+2 c}-\frac {-\frac {i \left (\operatorname {dilog}\left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )+\ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) \ln \left (-\frac {i-c -\left (i+c \right ) \coth \left (b x +a \right )}{2 c}\right )\right )}{2}+\frac {i \left (\operatorname {dilog}\left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )+\ln \left (c -\left (i+c \right ) \coth \left (b x +a \right )+i\right ) \ln \left (\frac {-i-c -\left (i+c \right ) \coth \left (b x +a \right )}{-2 i-2 c}\right )\right )}{2}}{2 \left (i+c \right )}\right )}{b \left (i+c \right )}\) \(545\)
risch \(\text {Expression too large to display}\) \(1221\)

Input:

int(arctan(c+(I+c)*coth(b*x+a)),x,method=_RETURNVERBOSE)
 

Output:

1/b/(I+c)*(-arctan(c+(I+c)*coth(b*x+a))/(2*I+2*c)*ln(I+c+(I+c)*coth(b*x+a) 
)+2*I*arctan(c+(I+c)*coth(b*x+a))/(2*I+2*c)*ln(I+c+(I+c)*coth(b*x+a))*c+ar 
ctan(c+(I+c)*coth(b*x+a))/(2*I+2*c)*ln(I+c+(I+c)*coth(b*x+a))*c^2+arctan(c 
+(I+c)*coth(b*x+a))/(2*I+2*c)*ln(c-(I+c)*coth(b*x+a)+I)-2*I*arctan(c+(I+c) 
*coth(b*x+a))/(2*I+2*c)*ln(c-(I+c)*coth(b*x+a)+I)*c-arctan(c+(I+c)*coth(b* 
x+a))/(2*I+2*c)*ln(c-(I+c)*coth(b*x+a)+I)*c^2-(I+c)^2*(1/2/(I+c)*(-1/2*I*( 
(ln(I+c+(I+c)*coth(b*x+a))-ln(-1/2*I*(I+c+(I+c)*coth(b*x+a))))*ln(-1/2*I*( 
I-c-(I+c)*coth(b*x+a)))-dilog(-1/2*I*(I+c+(I+c)*coth(b*x+a))))+1/4*I*ln(I+ 
c+(I+c)*coth(b*x+a))^2)-1/2/(I+c)*(-1/2*I*(dilog(-1/2*(I-c-(I+c)*coth(b*x+ 
a))/c)+ln(c-(I+c)*coth(b*x+a)+I)*ln(-1/2*(I-c-(I+c)*coth(b*x+a))/c))+1/2*I 
*(dilog((-I-c-(I+c)*coth(b*x+a))/(-2*I-2*c))+ln(c-(I+c)*coth(b*x+a)+I)*ln( 
(-I-c-(I+c)*coth(b*x+a))/(-2*I-2*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. 187 vs. \(2 (58) = 116\).

Time = 0.12 (sec) , antiderivative size = 187, normalized size of antiderivative = 2.37 \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=\frac {-i \, b^{2} x^{2} + i \, b x \log \left (-\frac {{\left (c + i\right )} e^{\left (2 \, b x + 2 \, a\right )}}{c e^{\left (2 \, b x + 2 \, a\right )} + i}\right ) + i \, a^{2} + {\left (i \, b x + i \, a\right )} \log \left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )} + 1\right ) - i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} + i \, \sqrt {4 i \, c}}{2 \, c}\right ) - i \, a \log \left (\frac {2 \, c e^{\left (b x + a\right )} - i \, \sqrt {4 i \, c}}{2 \, c}\right ) + i \, {\rm Li}_2\left (\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )}\right ) + i \, {\rm Li}_2\left (-\frac {1}{2} \, \sqrt {4 i \, c} e^{\left (b x + a\right )}\right )}{2 \, b} \] Input:

integrate(arctan(c+(I+c)*coth(b*x+a)),x, algorithm="fricas")
 

Output:

1/2*(-I*b^2*x^2 + I*b*x*log(-(c + I)*e^(2*b*x + 2*a)/(c*e^(2*b*x + 2*a) + 
I)) + I*a^2 + (I*b*x + I*a)*log(1/2*sqrt(4*I*c)*e^(b*x + a) + 1) + (I*b*x 
+ I*a)*log(-1/2*sqrt(4*I*c)*e^(b*x + a) + 1) - I*a*log(1/2*(2*c*e^(b*x + a 
) + I*sqrt(4*I*c))/c) - I*a*log(1/2*(2*c*e^(b*x + a) - I*sqrt(4*I*c))/c) + 
 I*dilog(1/2*sqrt(4*I*c)*e^(b*x + a)) + I*dilog(-1/2*sqrt(4*I*c)*e^(b*x + 
a)))/b
 

Sympy [F(-2)]

Exception generated. \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=\text {Exception raised: CoercionFailed} \] Input:

integrate(atan(c+(I+c)*coth(b*x+a)),x)
 

Output:

Exception raised: CoercionFailed >> Cannot convert _t0**2 - exp(2*a) of ty 
pe <class 'sympy.core.add.Add'> to QQ_I[b,_t0,exp(a)]
 

Maxima [A] (verification not implemented)

Time = 1.34 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.01 \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=2 \, b {\left (c + i\right )} {\left (\frac {2 \, x^{2}}{2 i \, c - 2} - \frac {2 \, b x \log \left (-i \, c e^{\left (2 \, b x + 2 \, a\right )} + 1\right ) + {\rm Li}_2\left (i \, c e^{\left (2 \, b x + 2 \, a\right )}\right )}{-2 \, b^{2} {\left (-i \, c + 1\right )}}\right )} + x \arctan \left ({\left (c + i\right )} \coth \left (b x + a\right ) + c\right ) \] Input:

integrate(arctan(c+(I+c)*coth(b*x+a)),x, algorithm="maxima")
 

Output:

2*b*(c + I)*(2*x^2/(2*I*c - 2) - (2*b*x*log(-I*c*e^(2*b*x + 2*a) + 1) + di 
log(I*c*e^(2*b*x + 2*a)))/(b^2*(2*I*c - 2))) + x*arctan((c + I)*coth(b*x + 
 a) + c)
 

Giac [F]

\[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=\int { \arctan \left ({\left (c + i\right )} \coth \left (b x + a\right ) + c\right ) \,d x } \] Input:

integrate(arctan(c+(I+c)*coth(b*x+a)),x, algorithm="giac")
 

Output:

integrate(arctan((c + I)*coth(b*x + a) + c), x)
 

Mupad [F(-1)]

Timed out. \[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=\int \mathrm {atan}\left (c+\mathrm {coth}\left (a+b\,x\right )\,\left (c+1{}\mathrm {i}\right )\right ) \,d x \] Input:

int(atan(c + coth(a + b*x)*(c + 1i)),x)
 

Output:

int(atan(c + coth(a + b*x)*(c + 1i)), x)
 

Reduce [F]

\[ \int \arctan (c+(i+c) \coth (a+b x)) \, dx=\int \mathit {atan} \left (\coth \left (b x +a \right ) c +\coth \left (b x +a \right ) i +c \right )d x \] Input:

int(atan(c+(I+c)*coth(b*x+a)),x)
 

Output:

int(atan(coth(a + b*x)*c + coth(a + b*x)*i + c),x)