3.82 \(\int x \tan ^{-1}(c+d \tanh (a+b x)) \, dx\)

Optimal. Leaf size=267 \[ -\frac{i \text{PolyLog}\left (3,-\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{8 b^2}+\frac{i \text{PolyLog}\left (3,-\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{8 b^2}+\frac{i x \text{PolyLog}\left (2,-\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b}-\frac{i x \text{PolyLog}\left (2,-\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{4 b}+\frac{1}{4} i x^2 \log \left (1+\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )+\frac{1}{2} x^2 \tan ^{-1}(d \tanh (a+b x)+c) \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.373405, antiderivative size = 267, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.385, Rules used = {5199, 2190, 2531, 2282, 6589} \[ -\frac{i \text{PolyLog}\left (3,-\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{8 b^2}+\frac{i \text{PolyLog}\left (3,-\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{8 b^2}+\frac{i x \text{PolyLog}\left (2,-\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )}{4 b}-\frac{i x \text{PolyLog}\left (2,-\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )}{4 b}+\frac{1}{4} i x^2 \log \left (1+\frac{(-c-d+i) e^{2 a+2 b x}}{-c+d+i}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(c+d+i) e^{2 a+2 b x}}{c-d+i}\right )+\frac{1}{2} x^2 \tan ^{-1}(d \tanh (a+b x)+c) \]

Antiderivative was successfully verified.

[In]

Int[x*ArcTan[c + d*Tanh[a + b*x]],x]

[Out]

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

Rule 5199

Int[ArcTan[(c_.) + (d_.)*Tanh[(a_.) + (b_.)*(x_)]]*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Simp[((e + f*x)^(m
 + 1)*ArcTan[c + d*Tanh[a + b*x]])/(f*(m + 1)), x] + (Dist[(I*b*(I - c - d))/(f*(m + 1)), Int[((e + f*x)^(m +
1)*E^(2*a + 2*b*x))/(I - c + d + (I - c - d)*E^(2*a + 2*b*x)), x], x] - Dist[(I*b*(I + c + d))/(f*(m + 1)), In
t[((e + f*x)^(m + 1)*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,
 e, f}, x] && IGtQ[m, 0] && NeQ[(c - d)^2, -1]

Rule 2190

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*Log[1 + (b*(F^(g*(e + f*x)))^n)/a])/(b*f*g*n*Log[F]), 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 2531

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] + Dist[(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 2282

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{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 6589

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

Rubi steps

\begin{align*} \int x \tan ^{-1}(c+d \tanh (a+b x)) \, dx &=\frac{1}{2} x^2 \tan ^{-1}(c+d \tanh (a+b x))+\frac{1}{2} (b (1-i (c+d))) \int \frac{e^{2 a+2 b x} x^2}{i+c-d+(i+c+d) e^{2 a+2 b x}} \, dx-\frac{1}{2} (b (1+i (c+d))) \int \frac{e^{2 a+2 b x} x^2}{i-c+d+(i-c-d) e^{2 a+2 b x}} \, dx\\ &=\frac{1}{2} x^2 \tan ^{-1}(c+d \tanh (a+b x))+\frac{1}{4} i x^2 \log \left (1+\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )-\frac{1}{2} i \int x \log \left (1+\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right ) \, dx+\frac{1}{2} i \int x \log \left (1+\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right ) \, dx\\ &=\frac{1}{2} x^2 \tan ^{-1}(c+d \tanh (a+b x))+\frac{1}{4} i x^2 \log \left (1+\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )+\frac{i x \text{Li}_2\left (-\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}-\frac{i x \text{Li}_2\left (-\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}-\frac{i \int \text{Li}_2\left (-\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right ) \, dx}{4 b}+\frac{i \int \text{Li}_2\left (-\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right ) \, dx}{4 b}\\ &=\frac{1}{2} x^2 \tan ^{-1}(c+d \tanh (a+b x))+\frac{1}{4} i x^2 \log \left (1+\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )+\frac{i x \text{Li}_2\left (-\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}-\frac{i x \text{Li}_2\left (-\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}-\frac{i \operatorname{Subst}\left (\int \frac{\text{Li}_2\left (-\frac{(-i+c+d) x}{-i+c-d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2}+\frac{i \operatorname{Subst}\left (\int \frac{\text{Li}_2\left (-\frac{(i+c+d) x}{i+c-d}\right )}{x} \, dx,x,e^{2 a+2 b x}\right )}{8 b^2}\\ &=\frac{1}{2} x^2 \tan ^{-1}(c+d \tanh (a+b x))+\frac{1}{4} i x^2 \log \left (1+\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )-\frac{1}{4} i x^2 \log \left (1+\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )+\frac{i x \text{Li}_2\left (-\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{4 b}-\frac{i x \text{Li}_2\left (-\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{4 b}-\frac{i \text{Li}_3\left (-\frac{(i-c-d) e^{2 a+2 b x}}{i-c+d}\right )}{8 b^2}+\frac{i \text{Li}_3\left (-\frac{(i+c+d) e^{2 a+2 b x}}{i+c-d}\right )}{8 b^2}\\ \end{align*}

Mathematica [A]  time = 3.9925, size = 229, normalized size = 0.86 \[ \frac{1}{2} x^2 \tan ^{-1}(d \tanh (a+b x)+c)+\frac{i \left (2 b x \text{PolyLog}\left (2,-\frac{(c+d-i) e^{2 (a+b x)}}{c-d-i}\right )-2 b x \text{PolyLog}\left (2,-\frac{(c+d+i) e^{2 (a+b x)}}{c-d+i}\right )-\text{PolyLog}\left (3,-\frac{(c+d-i) e^{2 (a+b x)}}{c-d-i}\right )+\text{PolyLog}\left (3,-\frac{(c+d+i) e^{2 (a+b x)}}{c-d+i}\right )+2 b^2 x^2 \log \left (1+\frac{(c+d-i) e^{2 (a+b x)}}{c-d-i}\right )-2 b^2 x^2 \log \left (1+\frac{(c+d+i) e^{2 (a+b x)}}{c-d+i}\right )\right )}{8 b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[x*ArcTan[c + d*Tanh[a + b*x]],x]

[Out]

(x^2*ArcTan[c + d*Tanh[a + b*x]])/2 + ((I/8)*(2*b^2*x^2*Log[1 + ((-I + c + d)*E^(2*(a + b*x)))/(-I + c - d)] -
 2*b^2*x^2*Log[1 + ((I + c + d)*E^(2*(a + b*x)))/(I + c - d)] + 2*b*x*PolyLog[2, -(((-I + c + d)*E^(2*(a + b*x
)))/(-I + c - d))] - 2*b*x*PolyLog[2, -(((I + c + d)*E^(2*(a + b*x)))/(I + c - d))] - PolyLog[3, -(((-I + c +
d)*E^(2*(a + b*x)))/(-I + c - d))] + PolyLog[3, -(((I + c + d)*E^(2*(a + b*x)))/(I + c - d))]))/b^2

________________________________________________________________________________________

Maple [C]  time = 16.382, size = 6640, normalized size = 24.9 \begin{align*} \text{output too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*arctan(c+d*tanh(b*x+a)),x)

[Out]

result too large to display

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{1}{2} \, x^{2} \arctan \left (\frac{{\left (c e^{\left (2 \, a\right )} + d e^{\left (2 \, a\right )}\right )} e^{\left (2 \, b x\right )} + c - d}{e^{\left (2 \, b x + 2 \, a\right )} + 1}\right ) - 2 \, b d \int \frac{x^{2} e^{\left (2 \, b x + 2 \, a\right )}}{c^{2} - 2 \, c d + d^{2} +{\left (c^{2} e^{\left (4 \, a\right )} + 2 \, c d e^{\left (4 \, a\right )} + d^{2} e^{\left (4 \, a\right )} + e^{\left (4 \, a\right )}\right )} e^{\left (4 \, b x\right )} + 2 \,{\left (c^{2} e^{\left (2 \, a\right )} - d^{2} e^{\left (2 \, a\right )} + e^{\left (2 \, a\right )}\right )} e^{\left (2 \, b x\right )} + 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(c+d*tanh(b*x+a)),x, algorithm="maxima")

[Out]

1/2*x^2*arctan(((c*e^(2*a) + d*e^(2*a))*e^(2*b*x) + c - d)/(e^(2*b*x + 2*a) + 1)) - 2*b*d*integrate(x^2*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)

________________________________________________________________________________________

Fricas [C]  time = 2.63717, size = 2985, normalized size = 11.18 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(c+d*tanh(b*x+a)),x, algorithm="fricas")

[Out]

1/4*(2*b^2*x^2*arctan((c*cosh(b*x + a) + d*sinh(b*x + a))/cosh(b*x + a)) + 2*I*b*x*dilog(1/2*sqrt(-(4*c^2 - 4*
d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) + 2*I*b*x*dilog(-1/2*sqrt(-(4*c^2 -
 4*d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) - 2*I*b*x*dilog(1/2*sqrt(-(4*c^2
 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) - 2*I*b*x*dilog(-1/2*sqrt(-(4*
c^2 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) + I*a^2*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) + (c^2 - d^2 - 2*I*d + 1)*sqrt(-(4*c^2 - 4*
d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))) + I*a^2*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) - (c^2 - d^2 - 2*I*d + 1)*sqrt(-(4*c^2 - 4*d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1)
)) - I*a^2*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) + (c^2 - d^2
+ 2*I*d + 1)*sqrt(-(4*c^2 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))) - I*a^2*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) - (c^2 - d^2 + 2*I*d + 1)*sqrt(-(4*c^2 - 4*d^2 - 8*I*
d + 4)/(c^2 - 2*c*d + d^2 + 1))) + (I*b^2*x^2 - I*a^2)*log(1/2*sqrt(-(4*c^2 - 4*d^2 + 8*I*d + 4)/(c^2 - 2*c*d
+ d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (I*b^2*x^2 - I*a^2)*log(-1/2*sqrt(-(4*c^2 - 4*d^2 + 8*I*d +
 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (-I*b^2*x^2 + I*a^2)*log(1/2*sqrt(-(4*c^2
- 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) + (-I*b^2*x^2 + I*a^2)*log(
-1/2*sqrt(-(4*c^2 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)) + 1) - 2*I*pol
ylog(3, 1/2*sqrt(-(4*c^2 - 4*d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) - 2*I*
polylog(3, -1/2*sqrt(-(4*c^2 - 4*d^2 + 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a))) +
2*I*polylog(3, 1/2*sqrt(-(4*c^2 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x + a)))
 + 2*I*polylog(3, -1/2*sqrt(-(4*c^2 - 4*d^2 - 8*I*d + 4)/(c^2 - 2*c*d + d^2 + 1))*(cosh(b*x + a) + sinh(b*x +
a))))/b^2

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*atan(c+d*tanh(b*x+a)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \arctan \left (d \tanh \left (b x + a\right ) + c\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*arctan(c+d*tanh(b*x+a)),x, algorithm="giac")

[Out]

integrate(x*arctan(d*tanh(b*x + a) + c), x)