Integrand size = 11, antiderivative size = 174 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=x \cot ^{-1}(c+d \tanh (a+b x))-\frac {1}{2} i x \log \left (1+\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )+\frac {1}{2} i x \log \left (1+\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac {i \operatorname {PolyLog}\left (2,-\frac {(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}+\frac {i \operatorname {PolyLog}\left (2,-\frac {(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b} \]
x*arccot(c+d*tanh(b*x+a))-1/2*I*x*ln(1+(I-c-d)*exp(2*b*x+2*a)/(I-c+d))+1/2 *I*x*ln(1+(I+c+d)*exp(2*b*x+2*a)/(I+c-d))-1/4*I*polylog(2,-(I-c-d)*exp(2*b *x+2*a)/(I-c+d))/b+1/4*I*polylog(2,-(I+c+d)*exp(2*b*x+2*a)/(I+c-d))/b
Time = 0.27 (sec) , antiderivative size = 288, normalized size of antiderivative = 1.66 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=x \cot ^{-1}(c+d \tanh (a+b x))-\frac {4 a \sqrt {-d^2} \arctan \left (\frac {1+c^2-d^2+\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{2 d}\right )-2 d (a+b x) \log \left (1+\frac {2 \left (1+(c+d)^2\right ) e^{2 (a+b x)}}{2+2 c^2-2 d^2-4 \sqrt {-d^2}}\right )+2 d (a+b x) \log \left (1+\frac {\left (1+(c+d)^2\right ) e^{2 (a+b x)}}{1+c^2-d^2+2 \sqrt {-d^2}}\right )+d \operatorname {PolyLog}\left (2,-\frac {\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{1+c^2-d^2+2 \sqrt {-d^2}}\right )-d \operatorname {PolyLog}\left (2,\frac {\left (1+c^2+2 c d+d^2\right ) e^{2 (a+b x)}}{-1-c^2+d^2+2 \sqrt {-d^2}}\right )}{4 b \sqrt {-d^2}} \]
x*ArcCot[c + d*Tanh[a + b*x]] - (4*a*Sqrt[-d^2]*ArcTan[(1 + c^2 - d^2 + (1 + c^2 + 2*c*d + d^2)*E^(2*(a + b*x)))/(2*d)] - 2*d*(a + b*x)*Log[1 + (2*( 1 + (c + d)^2)*E^(2*(a + b*x)))/(2 + 2*c^2 - 2*d^2 - 4*Sqrt[-d^2])] + 2*d* (a + b*x)*Log[1 + ((1 + (c + d)^2)*E^(2*(a + b*x)))/(1 + c^2 - d^2 + 2*Sqr t[-d^2])] + d*PolyLog[2, -(((1 + c^2 + 2*c*d + d^2)*E^(2*(a + b*x)))/(1 + c^2 - d^2 + 2*Sqrt[-d^2]))] - d*PolyLog[2, ((1 + c^2 + 2*c*d + d^2)*E^(2*( a + b*x)))/(-1 - c^2 + d^2 + 2*Sqrt[-d^2])])/(4*b*Sqrt[-d^2])
Time = 0.66 (sec) , antiderivative size = 237, normalized size of antiderivative = 1.36, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {5715, 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 \cot ^{-1}(d \tanh (a+b x)+c) \, dx\) |
\(\Big \downarrow \) 5715 |
\(\displaystyle b (1+i (c+d)) \int \frac {e^{2 a+2 b x} x}{-c+(-c-d+i) e^{2 a+2 b x}+d+i}dx-b (1-i (c+d)) \int \frac {e^{2 a+2 b x} x}{c+(c+d+i) e^{2 a+2 b x}-d+i}dx+x \cot ^{-1}(d \tanh (a+b x)+c)\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle b (1+i (c+d)) \left (\frac {x \log \left (1+\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{2 b (-c-d+i)}-\frac {\int \log \left (\frac {e^{2 a+2 b x} (-c-d+i)}{-c+d+i}+1\right )dx}{2 b (-c-d+i)}\right )-b (1-i (c+d)) \left (\frac {x \log \left (1+\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{2 b (c+d+i)}-\frac {\int \log \left (\frac {e^{2 a+2 b x} (c+d+i)}{c-d+i}+1\right )dx}{2 b (c+d+i)}\right )+x \cot ^{-1}(d \tanh (a+b x)+c)\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle b (1+i (c+d)) \left (\frac {x \log \left (1+\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{2 b (-c-d+i)}-\frac {\int e^{-2 a-2 b x} \log \left (\frac {e^{2 a+2 b x} (-c-d+i)}{-c+d+i}+1\right )de^{2 a+2 b x}}{4 b^2 (-c-d+i)}\right )-b (1-i (c+d)) \left (\frac {x \log \left (1+\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{2 b (c+d+i)}-\frac {\int e^{-2 a-2 b x} \log \left (\frac {e^{2 a+2 b x} (c+d+i)}{c-d+i}+1\right )de^{2 a+2 b x}}{4 b^2 (c+d+i)}\right )+x \cot ^{-1}(d \tanh (a+b x)+c)\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle b (1+i (c+d)) \left (\frac {\operatorname {PolyLog}\left (2,-\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b^2 (-c-d+i)}+\frac {x \log \left (1+\frac {(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{2 b (-c-d+i)}\right )-b (1-i (c+d)) \left (\frac {\operatorname {PolyLog}\left (2,-\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{4 b^2 (c+d+i)}+\frac {x \log \left (1+\frac {(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{2 b (c+d+i)}\right )+x \cot ^{-1}(d \tanh (a+b x)+c)\) |
x*ArcCot[c + d*Tanh[a + b*x]] + b*(1 + I*(c + d))*((x*Log[1 + ((I - c - d) *E^(2*a + 2*b*x))/(I - c + d)])/(2*b*(I - c - d)) + PolyLog[2, -(((I - c - d)*E^(2*a + 2*b*x))/(I - c + d))]/(4*b^2*(I - c - d))) - b*(1 - I*(c + d) )*((x*Log[1 + ((I + c + d)*E^(2*a + 2*b*x))/(I + c - d)])/(2*b*(I + c + d) ) + PolyLog[2, -(((I + c + d)*E^(2*a + 2*b*x))/(I + c - d))]/(4*b^2*(I + c + d)))
3.2.90.3.1 Defintions of rubi rules used
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[ArcCot[(c_.) + (d_.)*Tanh[(a_.) + (b_.)*(x_)]], x_Symbol] :> Simp[x*Arc Cot[c + d*Tanh[a + b*x]], x] + (-Simp[I*b*(I - c - d) Int[x*(E^(2*a + 2*b *x)/(I - c + d + (I - c - d)*E^(2*a + 2*b*x))), x], x] + Simp[I*b*(I + c + d) Int[x*(E^(2*a + 2*b*x)/(I + c - d + (I + c + d)*E^(2*a + 2*b*x))), x], x]) /; FreeQ[{a, b, c, d}, x] && NeQ[(c - d)^2, -1]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 351 vs. \(2 (150 ) = 300\).
Time = 3.03 (sec) , antiderivative size = 352, normalized size of antiderivative = 2.02
method | result | size |
derivativedivides | \(\frac {\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )-d \right )}{2}-\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )+d \right )}{2}-\frac {d^{2} \left (\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}}{d}-\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}}{d}\right )}{2}}{b d}\) | \(352\) |
default | \(\frac {\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )-d \right )}{2}-\frac {\operatorname {arccot}\left (c +d \tanh \left (b x +a \right )\right ) d \ln \left (-d \tanh \left (b x +a \right )+d \right )}{2}-\frac {d^{2} \left (\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )+d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c +d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c -d}\right )}{2}}{d}-\frac {\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \ln \left (-d \tanh \left (b x +a \right )-d \right ) \ln \left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}+\frac {i \operatorname {dilog}\left (\frac {i+d \tanh \left (b x +a \right )+c}{i+c -d}\right )}{2}-\frac {i \operatorname {dilog}\left (\frac {i-d \tanh \left (b x +a \right )-c}{i-c +d}\right )}{2}}{d}\right )}{2}}{b d}\) | \(352\) |
risch | \(\text {Expression too large to display}\) | \(4201\) |
1/b/d*(1/2*arccot(c+d*tanh(b*x+a))*d*ln(-d*tanh(b*x+a)-d)-1/2*arccot(c+d*t anh(b*x+a))*d*ln(-d*tanh(b*x+a)+d)-1/2*d^2*(1/d*(1/2*I*ln(-d*tanh(b*x+a)+d )*ln((I+d*tanh(b*x+a)+c)/(I+c+d))-1/2*I*ln(-d*tanh(b*x+a)+d)*ln((I-d*tanh( b*x+a)-c)/(I-c-d))+1/2*I*dilog((I+d*tanh(b*x+a)+c)/(I+c+d))-1/2*I*dilog((I -d*tanh(b*x+a)-c)/(I-c-d)))-1/d*(1/2*I*ln(-d*tanh(b*x+a)-d)*ln((I+d*tanh(b *x+a)+c)/(I+c-d))-1/2*I*ln(-d*tanh(b*x+a)-d)*ln((I-d*tanh(b*x+a)-c)/(I-c+d ))+1/2*I*dilog((I+d*tanh(b*x+a)+c)/(I+c-d))-1/2*I*dilog((I-d*tanh(b*x+a)-c )/(I-c+d)))))
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 825 vs. \(2 (128) = 256\).
Time = 0.40 (sec) , antiderivative size = 825, normalized size of antiderivative = 4.74 \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\frac {2 \, b x \arctan \left (\frac {\cosh \left (b x + a\right )}{c \cosh \left (b x + a\right ) + d \sinh \left (b x + a\right )}\right ) + i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) + 2 \, {\left (c^{2} - d^{2} - 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) + i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) - 2 \, {\left (c^{2} - d^{2} - 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) - i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) + 2 \, {\left (c^{2} - d^{2} + 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) - i \, a \log \left (2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \cosh \left (b x + a\right ) + 2 \, {\left (c^{2} + 2 \, c d + d^{2} + 1\right )} \sinh \left (b x + a\right ) - 2 \, {\left (c^{2} - d^{2} + 2 i \, d + 1\right )} \sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}}\right ) + {\left (-i \, b x - i \, a\right )} \log \left (\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (-i \, b x - i \, a\right )} \log \left (-\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) + {\left (i \, b x + i \, a\right )} \log \left (-\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )} + 1\right ) - i \, {\rm Li}_2\left (\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) - i \, {\rm Li}_2\left (-\sqrt {-\frac {c^{2} - d^{2} + 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + i \, {\rm Li}_2\left (\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right ) + i \, {\rm Li}_2\left (-\sqrt {-\frac {c^{2} - d^{2} - 2 i \, d + 1}{c^{2} - 2 \, c d + d^{2} + 1}} {\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right )}\right )}{2 \, b} \]
1/2*(2*b*x*arctan(cosh(b*x + a)/(c*cosh(b*x + a) + d*sinh(b*x + a))) + I*a *log(2*(c^2 + 2*c*d + d^2 + 1)*cosh(b*x + a) + 2*(c^2 + 2*c*d + d^2 + 1)*s inh(b*x + a) + 2*(c^2 - d^2 - 2*I*d + 1)*sqrt(-(c^2 - d^2 + 2*I*d + 1)/(c^ 2 - 2*c*d + d^2 + 1))) + I*a*log(2*(c^2 + 2*c*d + d^2 + 1)*cosh(b*x + a) + 2*(c^2 + 2*c*d + d^2 + 1)*sinh(b*x + a) - 2*(c^2 - d^2 - 2*I*d + 1)*sqrt( -(c^2 - d^2 + 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1))) - I*a*log(2*(c^2 + 2*c* d + d^2 + 1)*cosh(b*x + a) + 2*(c^2 + 2*c*d + d^2 + 1)*sinh(b*x + a) + 2*( c^2 - d^2 + 2*I*d + 1)*sqrt(-(c^2 - d^2 - 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1))) - I*a*log(2*(c^2 + 2*c*d + d^2 + 1)*cosh(b*x + a) + 2*(c^2 + 2*c*d + d^2 + 1)*sinh(b*x + a) - 2*(c^2 - d^2 + 2*I*d + 1)*sqrt(-(c^2 - d^2 - 2*I* d + 1)/(c^2 - 2*c*d + d^2 + 1))) + (-I*b*x - I*a)*log(sqrt(-(c^2 - d^2 + 2 *I*d + 1)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (-I*b*x - I*a)*log(-sqrt(-(c^2 - d^2 + 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1)) *(cosh(b*x + a) + sinh(b*x + a)) + 1) + (I*b*x + I*a)*log(sqrt(-(c^2 - d^2 - 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1 ) + (I*b*x + I*a)*log(-sqrt(-(c^2 - d^2 - 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) - I*dilog(sqrt(-(c^2 - d^2 + 2*I* d + 1)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) - I*dilog (-sqrt(-(c^2 - d^2 + 2*I*d + 1)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) + I*dilog(sqrt(-(c^2 - d^2 - 2*I*d + 1)/(c^2 - 2*c*d + ...
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int \operatorname {acot}{\left (c + d \tanh {\left (a + b x \right )} \right )}\, dx \]
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (d \tanh \left (b x + a\right ) + c\right ) \,d x } \]
4*b*d*integrate(x*e^(2*b*x + 2*a)/(c^2 - 2*c*d + d^2 + (c^2*e^(4*a) + 2*c* d*e^(4*a) + d^2*e^(4*a) + e^(4*a))*e^(4*b*x) + 2*(c^2*e^(2*a) - d^2*e^(2*a ) + e^(2*a))*e^(2*b*x) + 1), x) + x*arctan2(e^(2*b*x + 2*a) + 1, (c*e^(2*a ) + d*e^(2*a))*e^(2*b*x) + c - d)
\[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int { \operatorname {arccot}\left (d \tanh \left (b x + a\right ) + c\right ) \,d x } \]
Timed out. \[ \int \cot ^{-1}(c+d \tanh (a+b x)) \, dx=\int \mathrm {acot}\left (c+d\,\mathrm {tanh}\left (a+b\,x\right )\right ) \,d x \]