\(\int (c+d x)^2 \text {csch}(a+b x) \, dx\) [2]

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

Optimal result

Integrand size = 14, antiderivative size = 99 \[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=-\frac {2 (c+d x)^2 \text {arctanh}\left (e^{a+b x}\right )}{b}-\frac {2 d (c+d x) \operatorname {PolyLog}\left (2,-e^{a+b x}\right )}{b^2}+\frac {2 d (c+d x) \operatorname {PolyLog}\left (2,e^{a+b x}\right )}{b^2}+\frac {2 d^2 \operatorname {PolyLog}\left (3,-e^{a+b x}\right )}{b^3}-\frac {2 d^2 \operatorname {PolyLog}\left (3,e^{a+b x}\right )}{b^3} \] Output:

-2*(d*x+c)^2*arctanh(exp(b*x+a))/b-2*d*(d*x+c)*polylog(2,-exp(b*x+a))/b^2+ 
2*d*(d*x+c)*polylog(2,exp(b*x+a))/b^2+2*d^2*polylog(3,-exp(b*x+a))/b^3-2*d 
^2*polylog(3,exp(b*x+a))/b^3
 

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.19 \[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=\frac {(c+d x)^2 \log \left (1-e^{a+b x}\right )-(c+d x)^2 \log \left (1+e^{a+b x}\right )-\frac {2 d \left (b (c+d x) \operatorname {PolyLog}\left (2,-e^{a+b x}\right )-d \operatorname {PolyLog}\left (3,-e^{a+b x}\right )\right )}{b^2}+\frac {2 d \left (b (c+d x) \operatorname {PolyLog}\left (2,e^{a+b x}\right )-d \operatorname {PolyLog}\left (3,e^{a+b x}\right )\right )}{b^2}}{b} \] Input:

Integrate[(c + d*x)^2*Csch[a + b*x],x]
 

Output:

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

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.45 (sec) , antiderivative size = 115, 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.429, Rules used = {3042, 26, 4670, 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 (c+d x)^2 \text {csch}(a+b x) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int i (c+d x)^2 \csc (i a+i b x)dx\)

\(\Big \downarrow \) 26

\(\displaystyle i \int (c+d x)^2 \csc (i a+i b x)dx\)

\(\Big \downarrow \) 4670

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

\(\Big \downarrow \) 3011

\(\displaystyle i \left (-\frac {2 i d \left (\frac {d \int \operatorname {PolyLog}\left (2,-e^{a+b x}\right )dx}{b}-\frac {(c+d x) \operatorname {PolyLog}\left (2,-e^{a+b x}\right )}{b}\right )}{b}+\frac {2 i d \left (\frac {d \int \operatorname {PolyLog}\left (2,e^{a+b x}\right )dx}{b}-\frac {(c+d x) \operatorname {PolyLog}\left (2,e^{a+b x}\right )}{b}\right )}{b}+\frac {2 i (c+d x)^2 \text {arctanh}\left (e^{a+b x}\right )}{b}\right )\)

\(\Big \downarrow \) 2720

\(\displaystyle i \left (-\frac {2 i d \left (\frac {d \int e^{-a-b x} \operatorname {PolyLog}\left (2,-e^{a+b x}\right )de^{a+b x}}{b^2}-\frac {(c+d x) \operatorname {PolyLog}\left (2,-e^{a+b x}\right )}{b}\right )}{b}+\frac {2 i d \left (\frac {d \int e^{-a-b x} \operatorname {PolyLog}\left (2,e^{a+b x}\right )de^{a+b x}}{b^2}-\frac {(c+d x) \operatorname {PolyLog}\left (2,e^{a+b x}\right )}{b}\right )}{b}+\frac {2 i (c+d x)^2 \text {arctanh}\left (e^{a+b x}\right )}{b}\right )\)

\(\Big \downarrow \) 7143

\(\displaystyle i \left (\frac {2 i (c+d x)^2 \text {arctanh}\left (e^{a+b x}\right )}{b}-\frac {2 i d \left (\frac {d \operatorname {PolyLog}\left (3,-e^{a+b x}\right )}{b^2}-\frac {(c+d x) \operatorname {PolyLog}\left (2,-e^{a+b x}\right )}{b}\right )}{b}+\frac {2 i d \left (\frac {d \operatorname {PolyLog}\left (3,e^{a+b x}\right )}{b^2}-\frac {(c+d x) \operatorname {PolyLog}\left (2,e^{a+b x}\right )}{b}\right )}{b}\right )\)

Input:

Int[(c + d*x)^2*Csch[a + b*x],x]
 

Output:

I*(((2*I)*(c + d*x)^2*ArcTanh[E^(a + b*x)])/b - ((2*I)*d*(-(((c + d*x)*Pol 
yLog[2, -E^(a + b*x)])/b) + (d*PolyLog[3, -E^(a + b*x)])/b^2))/b + ((2*I)* 
d*(-(((c + d*x)*PolyLog[2, E^(a + b*x)])/b) + (d*PolyLog[3, E^(a + b*x)])/ 
b^2))/b)
 

Defintions of rubi rules used

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 2720
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]]]
 

rule 3011
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]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4670
Int[csc[(e_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x 
_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)]/(f*fz*I)), x] 
 + (-Simp[d*(m/(f*fz*I))   Int[(c + d*x)^(m - 1)*Log[1 - E^((-I)*e + f*fz*x 
)], x], x] + Simp[d*(m/(f*fz*I))   Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e 
+ f*fz*x)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]
 

rule 7143
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]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(305\) vs. \(2(94)=188\).

Time = 0.39 (sec) , antiderivative size = 306, normalized size of antiderivative = 3.09

method result size
risch \(-\frac {2 c^{2} \operatorname {arctanh}\left ({\mathrm e}^{b x +a}\right )}{b}+\frac {d^{2} \ln \left (1+{\mathrm e}^{b x +a}\right ) a^{2}}{b^{3}}-\frac {2 d^{2} \operatorname {polylog}\left (2, -{\mathrm e}^{b x +a}\right ) x}{b^{2}}-\frac {d^{2} \ln \left (1-{\mathrm e}^{b x +a}\right ) a^{2}}{b^{3}}+\frac {2 d^{2} \operatorname {polylog}\left (2, {\mathrm e}^{b x +a}\right ) x}{b^{2}}-\frac {2 c d \ln \left (1+{\mathrm e}^{b x +a}\right ) x}{b}-\frac {2 c d \operatorname {polylog}\left (2, -{\mathrm e}^{b x +a}\right )}{b^{2}}+\frac {2 c d \ln \left (1-{\mathrm e}^{b x +a}\right ) x}{b}+\frac {2 c d \operatorname {polylog}\left (2, {\mathrm e}^{b x +a}\right )}{b^{2}}-\frac {2 d^{2} a^{2} \operatorname {arctanh}\left ({\mathrm e}^{b x +a}\right )}{b^{3}}-\frac {2 c d \ln \left (1+{\mathrm e}^{b x +a}\right ) a}{b^{2}}+\frac {2 c d \ln \left (1-{\mathrm e}^{b x +a}\right ) a}{b^{2}}+\frac {4 d a c \,\operatorname {arctanh}\left ({\mathrm e}^{b x +a}\right )}{b^{2}}-\frac {d^{2} \ln \left (1+{\mathrm e}^{b x +a}\right ) x^{2}}{b}+\frac {2 d^{2} \operatorname {polylog}\left (3, -{\mathrm e}^{b x +a}\right )}{b^{3}}+\frac {d^{2} \ln \left (1-{\mathrm e}^{b x +a}\right ) x^{2}}{b}-\frac {2 d^{2} \operatorname {polylog}\left (3, {\mathrm e}^{b x +a}\right )}{b^{3}}\) \(306\)

Input:

int((d*x+c)^2*csch(b*x+a),x,method=_RETURNVERBOSE)
 

Output:

-2/b*c^2*arctanh(exp(b*x+a))+1/b^3*d^2*ln(1+exp(b*x+a))*a^2-2/b^2*d^2*poly 
log(2,-exp(b*x+a))*x-1/b^3*d^2*ln(1-exp(b*x+a))*a^2+2/b^2*d^2*polylog(2,ex 
p(b*x+a))*x-2/b*c*d*ln(1+exp(b*x+a))*x-2/b^2*c*d*polylog(2,-exp(b*x+a))+2/ 
b*c*d*ln(1-exp(b*x+a))*x+2/b^2*c*d*polylog(2,exp(b*x+a))-2/b^3*d^2*a^2*arc 
tanh(exp(b*x+a))-2/b^2*c*d*ln(1+exp(b*x+a))*a+2/b^2*c*d*ln(1-exp(b*x+a))*a 
+4/b^2*d*a*c*arctanh(exp(b*x+a))-1/b*d^2*ln(1+exp(b*x+a))*x^2+2*d^2*polylo 
g(3,-exp(b*x+a))/b^3+1/b*d^2*ln(1-exp(b*x+a))*x^2-2*d^2*polylog(3,exp(b*x+ 
a))/b^3
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 242 vs. \(2 (92) = 184\).

Time = 0.09 (sec) , antiderivative size = 242, normalized size of antiderivative = 2.44 \[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=-\frac {2 \, d^{2} {\rm polylog}\left (3, \cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right ) - 2 \, d^{2} {\rm polylog}\left (3, -\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )\right ) - 2 \, {\left (b d^{2} x + b c d\right )} {\rm Li}_2\left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right )\right ) + 2 \, {\left (b d^{2} x + b c d\right )} {\rm Li}_2\left (-\cosh \left (b x + a\right ) - \sinh \left (b x + a\right )\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) + 1\right ) - {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (\cosh \left (b x + a\right ) + \sinh \left (b x + a\right ) - 1\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cosh \left (b x + a\right ) - \sinh \left (b x + a\right ) + 1\right )}{b^{3}} \] Input:

integrate((d*x+c)^2*csch(b*x+a),x, algorithm="fricas")
 

Output:

-(2*d^2*polylog(3, cosh(b*x + a) + sinh(b*x + a)) - 2*d^2*polylog(3, -cosh 
(b*x + a) - sinh(b*x + a)) - 2*(b*d^2*x + b*c*d)*dilog(cosh(b*x + a) + sin 
h(b*x + a)) + 2*(b*d^2*x + b*c*d)*dilog(-cosh(b*x + a) - sinh(b*x + a)) + 
(b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2)*log(cosh(b*x + a) + sinh(b*x + a) + 
1) - (b^2*c^2 - 2*a*b*c*d + a^2*d^2)*log(cosh(b*x + a) + sinh(b*x + a) - 1 
) - (b^2*d^2*x^2 + 2*b^2*c*d*x + 2*a*b*c*d - a^2*d^2)*log(-cosh(b*x + a) - 
 sinh(b*x + a) + 1))/b^3
 

Sympy [F]

\[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=\int \left (c + d x\right )^{2} \operatorname {csch}{\left (a + b x \right )}\, dx \] Input:

integrate((d*x+c)**2*csch(b*x+a),x)
 

Output:

Integral((c + d*x)**2*csch(a + b*x), x)
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (92) = 184\).

Time = 0.12 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.97 \[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=-c^{2} {\left (\frac {\log \left (e^{\left (-b x - a\right )} + 1\right )}{b} - \frac {\log \left (e^{\left (-b x - a\right )} - 1\right )}{b}\right )} - \frac {2 \, {\left (b x \log \left (e^{\left (b x + a\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (b x + a\right )}\right )\right )} c d}{b^{2}} + \frac {2 \, {\left (b x \log \left (-e^{\left (b x + a\right )} + 1\right ) + {\rm Li}_2\left (e^{\left (b x + a\right )}\right )\right )} c d}{b^{2}} - \frac {{\left (b^{2} x^{2} \log \left (e^{\left (b x + a\right )} + 1\right ) + 2 \, b x {\rm Li}_2\left (-e^{\left (b x + a\right )}\right ) - 2 \, {\rm Li}_{3}(-e^{\left (b x + a\right )})\right )} d^{2}}{b^{3}} + \frac {{\left (b^{2} x^{2} \log \left (-e^{\left (b x + a\right )} + 1\right ) + 2 \, b x {\rm Li}_2\left (e^{\left (b x + a\right )}\right ) - 2 \, {\rm Li}_{3}(e^{\left (b x + a\right )})\right )} d^{2}}{b^{3}} \] Input:

integrate((d*x+c)^2*csch(b*x+a),x, algorithm="maxima")
                                                                                    
                                                                                    
 

Output:

-c^2*(log(e^(-b*x - a) + 1)/b - log(e^(-b*x - a) - 1)/b) - 2*(b*x*log(e^(b 
*x + a) + 1) + dilog(-e^(b*x + a)))*c*d/b^2 + 2*(b*x*log(-e^(b*x + a) + 1) 
 + dilog(e^(b*x + a)))*c*d/b^2 - (b^2*x^2*log(e^(b*x + a) + 1) + 2*b*x*dil 
og(-e^(b*x + a)) - 2*polylog(3, -e^(b*x + a)))*d^2/b^3 + (b^2*x^2*log(-e^( 
b*x + a) + 1) + 2*b*x*dilog(e^(b*x + a)) - 2*polylog(3, e^(b*x + a)))*d^2/ 
b^3
 

Giac [F]

\[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=\int { {\left (d x + c\right )}^{2} \operatorname {csch}\left (b x + a\right ) \,d x } \] Input:

integrate((d*x+c)^2*csch(b*x+a),x, algorithm="giac")
 

Output:

integrate((d*x + c)^2*csch(b*x + a), x)
 

Mupad [F(-1)]

Timed out. \[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=\int \frac {{\left (c+d\,x\right )}^2}{\mathrm {sinh}\left (a+b\,x\right )} \,d x \] Input:

int((c + d*x)^2/sinh(a + b*x),x)
 

Output:

int((c + d*x)^2/sinh(a + b*x), x)
 

Reduce [F]

\[ \int (c+d x)^2 \text {csch}(a+b x) \, dx=\frac {\left (\int \mathrm {csch}\left (b x +a \right ) x^{2}d x \right ) b \,d^{2}+2 \left (\int \mathrm {csch}\left (b x +a \right ) x d x \right ) b c d +\mathrm {log}\left (e^{b x +a}-1\right ) c^{2}-\mathrm {log}\left (e^{b x +a}+1\right ) c^{2}}{b} \] Input:

int((d*x+c)^2*csch(b*x+a),x)
 

Output:

(int(csch(a + b*x)*x**2,x)*b*d**2 + 2*int(csch(a + b*x)*x,x)*b*c*d + log(e 
**(a + b*x) - 1)*c**2 - log(e**(a + b*x) + 1)*c**2)/b