Integrand size = 13, antiderivative size = 293 \[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\frac {1}{2} x^2 \text {arctanh}(c+d \cot (a+b x))+\frac {1}{4} x^2 \log \left (1-\frac {(1-c-i d) e^{2 i a+2 i b x}}{1-c+i d}\right )-\frac {1}{4} x^2 \log \left (1-\frac {(1+c+i d) e^{2 i a+2 i b x}}{1+c-i d}\right )-\frac {i x \operatorname {PolyLog}\left (2,\frac {(1-c-i d) e^{2 i a+2 i b x}}{1-c+i d}\right )}{4 b}+\frac {i x \operatorname {PolyLog}\left (2,\frac {(1+c+i d) e^{2 i a+2 i b x}}{1+c-i d}\right )}{4 b}+\frac {\operatorname {PolyLog}\left (3,\frac {(1-c-i d) e^{2 i a+2 i b x}}{1-c+i d}\right )}{8 b^2}-\frac {\operatorname {PolyLog}\left (3,\frac {(1+c+i d) e^{2 i a+2 i b x}}{1+c-i d}\right )}{8 b^2} \]
1/2*x^2*arctanh(c+d*cot(b*x+a))+1/4*x^2*ln(1-(1-c-I*d)*exp(2*I*a+2*I*b*x)/ (1-c+I*d))-1/4*x^2*ln(1-(1+c+I*d)*exp(2*I*a+2*I*b*x)/(1+c-I*d))-1/4*I*x*po lylog(2,(1-c-I*d)*exp(2*I*a+2*I*b*x)/(1-c+I*d))/b+1/4*I*x*polylog(2,(1+c+I *d)*exp(2*I*a+2*I*b*x)/(1+c-I*d))/b+1/8*polylog(3,(1-c-I*d)*exp(2*I*a+2*I* b*x)/(1-c+I*d))/b^2-1/8*polylog(3,(1+c+I*d)*exp(2*I*a+2*I*b*x)/(1+c-I*d))/ b^2
Time = 2.82 (sec) , antiderivative size = 255, normalized size of antiderivative = 0.87 \[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\frac {4 b^2 x^2 \text {arctanh}(c+d \cot (a+b x))+2 b^2 x^2 \log \left (1+\frac {(1-c+i d) e^{-2 i (a+b x)}}{-1+c+i d}\right )-2 b^2 x^2 \log \left (1+\frac {(-1-c+i d) e^{-2 i (a+b x)}}{1+c+i d}\right )+2 i b x \operatorname {PolyLog}\left (2,\frac {(-1+c-i d) e^{-2 i (a+b x)}}{-1+c+i d}\right )-2 i b x \operatorname {PolyLog}\left (2,\frac {(1+c-i d) e^{-2 i (a+b x)}}{1+c+i d}\right )+\operatorname {PolyLog}\left (3,\frac {(-1+c-i d) e^{-2 i (a+b x)}}{-1+c+i d}\right )-\operatorname {PolyLog}\left (3,\frac {(1+c-i d) e^{-2 i (a+b x)}}{1+c+i d}\right )}{8 b^2} \]
(4*b^2*x^2*ArcTanh[c + d*Cot[a + b*x]] + 2*b^2*x^2*Log[1 + (1 - c + I*d)/( (-1 + c + I*d)*E^((2*I)*(a + b*x)))] - 2*b^2*x^2*Log[1 + (-1 - c + I*d)/(( 1 + c + I*d)*E^((2*I)*(a + b*x)))] + (2*I)*b*x*PolyLog[2, (-1 + c - I*d)/( (-1 + c + I*d)*E^((2*I)*(a + b*x)))] - (2*I)*b*x*PolyLog[2, (1 + c - I*d)/ ((1 + c + I*d)*E^((2*I)*(a + b*x)))] + PolyLog[3, (-1 + c - I*d)/((-1 + c + I*d)*E^((2*I)*(a + b*x)))] - PolyLog[3, (1 + c - I*d)/((1 + c + I*d)*E^( (2*I)*(a + b*x)))])/(8*b^2)
Time = 1.13 (sec) , antiderivative size = 394, normalized size of antiderivative = 1.34, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {6823, 2620, 3011, 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 \text {arctanh}(d \cot (a+b x)+c) \, dx\) |
\(\Big \downarrow \) 6823 |
\(\displaystyle -\frac {1}{2} b (-i c+d+i) \int \frac {e^{2 i a+2 i b x} x^2}{-c-(-c-i d+1) e^{2 i a+2 i b x}+i d+1}dx+\frac {1}{2} b (-d+i (c+1)) \int \frac {e^{2 i a+2 i b x} x^2}{c-(c+i d+1) e^{2 i a+2 i b x}-i d+1}dx+\frac {1}{2} x^2 \text {arctanh}(d \cot (a+b x)+c)\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle -\frac {1}{2} b (-i c+d+i) \left (\frac {\int x \log \left (1-\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )dx}{b (d+i (1-c))}-\frac {x^2 \log \left (1-\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b (d+i (1-c))}\right )+\frac {1}{2} b (-d+i (c+1)) \left (\frac {\int x \log \left (1-\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )dx}{-b d+i (b c+b)}-\frac {x^2 \log \left (1-\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 (-b d+i (b c+b))}\right )+\frac {1}{2} x^2 \text {arctanh}(d \cot (a+b x)+c)\) |
\(\Big \downarrow \) 3011 |
\(\displaystyle -\frac {1}{2} b (-i c+d+i) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b}-\frac {i \int \operatorname {PolyLog}\left (2,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )dx}{2 b}}{b (d+i (1-c))}-\frac {x^2 \log \left (1-\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b (d+i (1-c))}\right )+\frac {1}{2} b (-d+i (c+1)) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 b}-\frac {i \int \operatorname {PolyLog}\left (2,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )dx}{2 b}}{-b d+i (b c+b)}-\frac {x^2 \log \left (1-\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 (-b d+i (b c+b))}\right )+\frac {1}{2} x^2 \text {arctanh}(d \cot (a+b x)+c)\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle -\frac {1}{2} b (-i c+d+i) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b}-\frac {\int e^{-2 i a-2 i b x} \operatorname {PolyLog}\left (2,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )de^{2 i a+2 i b x}}{4 b^2}}{b (d+i (1-c))}-\frac {x^2 \log \left (1-\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b (d+i (1-c))}\right )+\frac {1}{2} b (-d+i (c+1)) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 b}-\frac {\int e^{-2 i a-2 i b x} \operatorname {PolyLog}\left (2,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )de^{2 i a+2 i b x}}{4 b^2}}{-b d+i (b c+b)}-\frac {x^2 \log \left (1-\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 (-b d+i (b c+b))}\right )+\frac {1}{2} x^2 \text {arctanh}(d \cot (a+b x)+c)\) |
\(\Big \downarrow \) 7143 |
\(\displaystyle \frac {1}{2} x^2 \text {arctanh}(d \cot (a+b x)+c)-\frac {1}{2} b (-i c+d+i) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b}-\frac {\operatorname {PolyLog}\left (3,\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{4 b^2}}{b (d+i (1-c))}-\frac {x^2 \log \left (1-\frac {(-c-i d+1) e^{2 i a+2 i b x}}{-c+i d+1}\right )}{2 b (d+i (1-c))}\right )+\frac {1}{2} b (-d+i (c+1)) \left (\frac {\frac {i x \operatorname {PolyLog}\left (2,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 b}-\frac {\operatorname {PolyLog}\left (3,\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{4 b^2}}{-b d+i (b c+b)}-\frac {x^2 \log \left (1-\frac {(c+i d+1) e^{2 i a+2 i b x}}{c-i d+1}\right )}{2 (-b d+i (b c+b))}\right )\) |
(x^2*ArcTanh[c + d*Cot[a + b*x]])/2 - (b*(I - I*c + d)*(-1/2*(x^2*Log[1 - ((1 - c - I*d)*E^((2*I)*a + (2*I)*b*x))/(1 - c + I*d)])/(b*(I*(1 - c) + d) ) + (((I/2)*x*PolyLog[2, ((1 - c - I*d)*E^((2*I)*a + (2*I)*b*x))/(1 - c + I*d)])/b - PolyLog[3, ((1 - c - I*d)*E^((2*I)*a + (2*I)*b*x))/(1 - c + I*d )]/(4*b^2))/(b*(I*(1 - c) + d))))/2 + (b*(I*(1 + c) - d)*(-1/2*(x^2*Log[1 - ((1 + c + I*d)*E^((2*I)*a + (2*I)*b*x))/(1 + c - I*d)])/(I*(b + b*c) - b *d) + (((I/2)*x*PolyLog[2, ((1 + c + I*d)*E^((2*I)*a + (2*I)*b*x))/(1 + c - I*d)])/b - PolyLog[3, ((1 + c + I*d)*E^((2*I)*a + (2*I)*b*x))/(1 + c - I *d)]/(4*b^2))/(I*(b + b*c) - b*d)))/2
3.4.35.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[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]]]
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]
Int[ArcTanh[(c_.) + Cot[(a_.) + (b_.)*(x_)]*(d_.)]*((e_.) + (f_.)*(x_))^(m_ .), x_Symbol] :> Simp[(e + f*x)^(m + 1)*(ArcTanh[c + d*Cot[a + b*x]]/(f*(m + 1))), x] + (-Simp[I*b*((1 - c - I*d)/(f*(m + 1))) Int[(e + f*x)^(m + 1) *(E^(2*I*a + 2*I*b*x)/(1 - c + I*d - (1 - c - I*d)*E^(2*I*a + 2*I*b*x))), x ], x] + Simp[I*b*((1 + c + I*d)/(f*(m + 1))) Int[(e + f*x)^(m + 1)*(E^(2* I*a + 2*I*b*x)/(1 + c - I*d - (1 + c + I*d)*E^(2*I*a + 2*I*b*x))), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[m, 0] && NeQ[(c - I*d)^2, 1]
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]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 3.45 (sec) , antiderivative size = 6343, normalized size of antiderivative = 21.65
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1463 vs. \(2 (207) = 414\).
Time = 0.41 (sec) , antiderivative size = 1463, normalized size of antiderivative = 4.99 \[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\text {Too large to display} \]
1/16*(4*b^2*x^2*log(-(d*cos(2*b*x + 2*a) + (c + 1)*sin(2*b*x + 2*a) + d)/( d*cos(2*b*x + 2*a) + (c - 1)*sin(2*b*x + 2*a) + d)) + 2*I*b*x*dilog(-(c^2 + d^2 - (c^2 + 2*I*(c + 1)*d - d^2 + 2*c + 1)*cos(2*b*x + 2*a) + (-I*c^2 + 2*(c + 1)*d + I*d^2 - 2*I*c - I)*sin(2*b*x + 2*a) + 2*c + 1)/(c^2 + d^2 + 2*c + 1) + 1) - 2*I*b*x*dilog(-(c^2 + d^2 - (c^2 - 2*I*(c + 1)*d - d^2 + 2*c + 1)*cos(2*b*x + 2*a) + (I*c^2 + 2*(c + 1)*d - I*d^2 + 2*I*c + I)*sin( 2*b*x + 2*a) + 2*c + 1)/(c^2 + d^2 + 2*c + 1) + 1) - 2*I*b*x*dilog(-(c^2 + d^2 - (c^2 + 2*I*(c - 1)*d - d^2 - 2*c + 1)*cos(2*b*x + 2*a) + (-I*c^2 + 2*(c - 1)*d + I*d^2 + 2*I*c - I)*sin(2*b*x + 2*a) - 2*c + 1)/(c^2 + d^2 - 2*c + 1) + 1) + 2*I*b*x*dilog(-(c^2 + d^2 - (c^2 - 2*I*(c - 1)*d - d^2 - 2 *c + 1)*cos(2*b*x + 2*a) + (I*c^2 + 2*(c - 1)*d - I*d^2 - 2*I*c + I)*sin(2 *b*x + 2*a) - 2*c + 1)/(c^2 + d^2 - 2*c + 1) + 1) - 2*a^2*log(1/2*c^2 + I* (c + 1)*d - 1/2*d^2 - 1/2*(c^2 + d^2 + 2*c + 1)*cos(2*b*x + 2*a) + 1/2*(I* c^2 + I*d^2 + 2*I*c + I)*sin(2*b*x + 2*a) + c + 1/2) + 2*a^2*log(1/2*c^2 + I*(c - 1)*d - 1/2*d^2 - 1/2*(c^2 + d^2 - 2*c + 1)*cos(2*b*x + 2*a) + 1/2* (I*c^2 + I*d^2 - 2*I*c + I)*sin(2*b*x + 2*a) - c + 1/2) - 2*a^2*log(-1/2*c ^2 + I*(c + 1)*d + 1/2*d^2 + 1/2*(c^2 + d^2 + 2*c + 1)*cos(2*b*x + 2*a) + 1/2*(I*c^2 + I*d^2 + 2*I*c + I)*sin(2*b*x + 2*a) - c - 1/2) + 2*a^2*log(-1 /2*c^2 + I*(c - 1)*d + 1/2*d^2 + 1/2*(c^2 + d^2 - 2*c + 1)*cos(2*b*x + 2*a ) + 1/2*(I*c^2 + I*d^2 - 2*I*c + I)*sin(2*b*x + 2*a) + c - 1/2) - 2*(b^...
\[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\int x \operatorname {atanh}{\left (c + d \cot {\left (a + b x \right )} \right )}\, dx \]
\[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\int { x \operatorname {artanh}\left (d \cot \left (b x + a\right ) + c\right ) \,d x } \]
-2*b*d*integrate((2*(c^2 + d^2 - 1)*x^2*cos(2*b*x + 2*a)^2 + 2*c*d*x^2*sin (2*b*x + 2*a) + 2*(c^2 + d^2 - 1)*x^2*sin(2*b*x + 2*a)^2 - (c^2 - d^2 - 1) *x^2*cos(2*b*x + 2*a) - (2*c*d*x^2*sin(2*b*x + 2*a) + (c^2 - d^2 - 1)*x^2* cos(2*b*x + 2*a))*cos(4*b*x + 4*a) + (2*c*d*x^2*cos(2*b*x + 2*a) - (c^2 - d^2 - 1)*x^2*sin(2*b*x + 2*a))*sin(4*b*x + 4*a))/(c^4 + d^4 + 2*(c^2 + 1)* d^2 + (c^4 + d^4 + 2*(c^2 + 1)*d^2 - 2*c^2 + 1)*cos(4*b*x + 4*a)^2 + 4*(c^ 4 + d^4 + 2*(c^2 - 1)*d^2 - 2*c^2 + 1)*cos(2*b*x + 2*a)^2 + (c^4 + d^4 + 2 *(c^2 + 1)*d^2 - 2*c^2 + 1)*sin(4*b*x + 4*a)^2 + 4*(c^4 + d^4 + 2*(c^2 - 1 )*d^2 - 2*c^2 + 1)*sin(2*b*x + 2*a)^2 - 2*c^2 + 2*(c^4 + d^4 - 2*(3*c^2 - 1)*d^2 - 2*c^2 - 2*(c^4 - d^4 - 2*c^2 + 1)*cos(2*b*x + 2*a) - 4*(c*d^3 + ( c^3 - c)*d)*sin(2*b*x + 2*a) + 1)*cos(4*b*x + 4*a) - 4*(c^4 - d^4 - 2*c^2 + 1)*cos(2*b*x + 2*a) + 4*(2*c*d^3 - 2*(c^3 - c)*d + 2*(c*d^3 + (c^3 - c)* d)*cos(2*b*x + 2*a) - (c^4 - d^4 - 2*c^2 + 1)*sin(2*b*x + 2*a))*sin(4*b*x + 4*a) + 8*(c*d^3 + (c^3 - c)*d)*sin(2*b*x + 2*a) + 1), x) + 1/8*x^2*log(( c^2 + d^2 + 2*c + 1)*cos(2*b*x + 2*a)^2 + 4*(c + 1)*d*sin(2*b*x + 2*a) + ( c^2 + d^2 + 2*c + 1)*sin(2*b*x + 2*a)^2 + c^2 + d^2 - 2*(c^2 - d^2 + 2*c + 1)*cos(2*b*x + 2*a) + 2*c + 1) - 1/8*x^2*log((c^2 + d^2 - 2*c + 1)*cos(2* b*x + 2*a)^2 + 4*(c - 1)*d*sin(2*b*x + 2*a) + (c^2 + d^2 - 2*c + 1)*sin(2* b*x + 2*a)^2 + c^2 + d^2 - 2*(c^2 - d^2 - 2*c + 1)*cos(2*b*x + 2*a) - 2*c + 1)
\[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\int { x \operatorname {artanh}\left (d \cot \left (b x + a\right ) + c\right ) \,d x } \]
Timed out. \[ \int x \text {arctanh}(c+d \cot (a+b x)) \, dx=\int x\,\mathrm {atanh}\left (c+d\,\mathrm {cot}\left (a+b\,x\right )\right ) \,d x \]