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

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [C] (warning: unable to verify)
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [A] (verification not implemented)
Giac [F]
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 22, antiderivative size = 80 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=\frac {a^2 (e x)^n}{e n}-\frac {2 a b x^{-n} (e x)^n \text {arctanh}\left (\cosh \left (c+d x^n\right )\right )}{d e n}-\frac {b^2 x^{-n} (e x)^n \coth \left (c+d x^n\right )}{d e n} \] Output:

a^2*(e*x)^n/e/n-2*a*b*(e*x)^n*arctanh(cosh(c+d*x^n))/d/e/n/(x^n)-b^2*(e*x) 
^n*coth(c+d*x^n)/d/e/n/(x^n)
 

Mathematica [A] (verified)

Time = 0.84 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.29 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=\frac {x^{-n} (e x)^n \left (-b^2 \coth \left (\frac {1}{2} \left (c+d x^n\right )\right )+2 a \left (a c+a d x^n-2 b \log \left (\cosh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )+2 b \log \left (\sinh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )\right )-b^2 \tanh \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{2 d e n} \] Input:

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

Output:

((e*x)^n*(-(b^2*Coth[(c + d*x^n)/2]) + 2*a*(a*c + a*d*x^n - 2*b*Log[Cosh[( 
c + d*x^n)/2]] + 2*b*Log[Sinh[(c + d*x^n)/2]]) - b^2*Tanh[(c + d*x^n)/2])) 
/(2*d*e*n*x^n)
 

Rubi [A] (verified)

Time = 0.50 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.71, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.545, Rules used = {5964, 5960, 3042, 4260, 25, 26, 3042, 25, 26, 4254, 24, 4257}

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 (e x)^{n-1} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx\)

\(\Big \downarrow \) 5964

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

\(\Big \downarrow \) 5960

\(\displaystyle \frac {x^{-n} (e x)^n \int \left (a+b \text {csch}\left (d x^n+c\right )\right )^2dx^n}{e n}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4260

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 26

\(\displaystyle \frac {x^{-n} (e x)^n \left (2 a b \int \text {csch}\left (d x^n+c\right )dx^n+b^2 \int \text {csch}^2\left (d x^n+c\right )dx^n+a^2 x^n\right )}{e n}\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 4254

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

\(\Big \downarrow \) 24

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

\(\Big \downarrow \) 4257

\(\displaystyle \frac {x^{-n} (e x)^n \left (a^2 x^n-\frac {2 a b \text {arctanh}\left (\cosh \left (c+d x^n\right )\right )}{d}-\frac {b^2 \coth \left (c+d x^n\right )}{d}\right )}{e n}\)

Input:

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

Output:

((e*x)^n*(a^2*x^n - (2*a*b*ArcTanh[Cosh[c + d*x^n]])/d - (b^2*Coth[c + d*x 
^n])/d))/(e*n*x^n)
 

Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4260
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^2, x_Symbol] :> Simp[a^2*x, x] + 
 (Simp[2*a*b   Int[Csc[c + d*x], x], x] + Simp[b^2   Int[Csc[c + d*x]^2, x] 
, x]) /; FreeQ[{a, b, c, d}, x]
 

rule 5960
Int[((a_.) + Csch[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbo 
l] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Csch[c + d*x] 
)^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m 
 + 1)/n], 0] && IntegerQ[p]
 

rule 5964
Int[((a_.) + Csch[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*((e_)*(x_))^(m_.), 
x_Symbol] :> Simp[e^IntPart[m]*((e*x)^FracPart[m]/x^FracPart[m])   Int[x^m* 
(a + b*Csch[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 1.75 (sec) , antiderivative size = 271, normalized size of antiderivative = 3.39

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

Input:

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

Output:

a^2/n*x*exp(1/2*(-1+n)*(-I*Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+I*Pi*csgn(I* 
e)*csgn(I*e*x)^2+I*Pi*csgn(I*x)*csgn(I*e*x)^2-I*Pi*csgn(I*e*x)^3+2*ln(x)+2 
*ln(e)))-2/d/n*x/(x^n)*b^2*exp(1/2*(-1+n)*(-I*Pi*csgn(I*e)*csgn(I*x)*csgn( 
I*e*x)+I*Pi*csgn(I*e)*csgn(I*e*x)^2+I*Pi*csgn(I*x)*csgn(I*e*x)^2-I*Pi*csgn 
(I*e*x)^3+2*ln(x)+2*ln(e)))/(exp(2*c+2*d*x^n)-1)-4*arctanh(exp(c+d*x^n))/d 
/e*e^n/n*a*b*exp(1/2*I*Pi*csgn(I*e*x)*(-1+n)*(csgn(I*e*x)-csgn(I*x))*(-csg 
n(I*e*x)+csgn(I*e)))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 854 vs. \(2 (80) = 160\).

Time = 0.10 (sec) , antiderivative size = 854, normalized size of antiderivative = 10.68 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=\text {Too large to display} \] Input:

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

Output:

-(a^2*d*cosh((n - 1)*log(e))*cosh(n*log(x)) - (a^2*d*cosh((n - 1)*log(e))* 
cosh(n*log(x)) + a^2*d*cosh(n*log(x))*sinh((n - 1)*log(e)) + (a^2*d*cosh(( 
n - 1)*log(e)) + a^2*d*sinh((n - 1)*log(e)))*sinh(n*log(x)))*cosh(d*cosh(n 
*log(x)) + d*sinh(n*log(x)) + c)^2 + 2*b^2*cosh((n - 1)*log(e)) - 2*(a^2*d 
*cosh((n - 1)*log(e))*cosh(n*log(x)) + a^2*d*cosh(n*log(x))*sinh((n - 1)*l 
og(e)) + (a^2*d*cosh((n - 1)*log(e)) + a^2*d*sinh((n - 1)*log(e)))*sinh(n* 
log(x)))*cosh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c)*sinh(d*cosh(n*log(x 
)) + d*sinh(n*log(x)) + c) - (a^2*d*cosh((n - 1)*log(e))*cosh(n*log(x)) + 
a^2*d*cosh(n*log(x))*sinh((n - 1)*log(e)) + (a^2*d*cosh((n - 1)*log(e)) + 
a^2*d*sinh((n - 1)*log(e)))*sinh(n*log(x)))*sinh(d*cosh(n*log(x)) + d*sinh 
(n*log(x)) + c)^2 + 2*((a*b*cosh((n - 1)*log(e)) + a*b*sinh((n - 1)*log(e) 
))*cosh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c)^2 - a*b*cosh((n - 1)*log( 
e)) + 2*(a*b*cosh((n - 1)*log(e)) + a*b*sinh((n - 1)*log(e)))*cosh(d*cosh( 
n*log(x)) + d*sinh(n*log(x)) + c)*sinh(d*cosh(n*log(x)) + d*sinh(n*log(x)) 
 + c) + (a*b*cosh((n - 1)*log(e)) + a*b*sinh((n - 1)*log(e)))*sinh(d*cosh( 
n*log(x)) + d*sinh(n*log(x)) + c)^2 - a*b*sinh((n - 1)*log(e)))*log(cosh(d 
*cosh(n*log(x)) + d*sinh(n*log(x)) + c) + sinh(d*cosh(n*log(x)) + d*sinh(n 
*log(x)) + c) + 1) - 2*((a*b*cosh((n - 1)*log(e)) + a*b*sinh((n - 1)*log(e 
)))*cosh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c)^2 - a*b*cosh((n - 1)*log 
(e)) + 2*(a*b*cosh((n - 1)*log(e)) + a*b*sinh((n - 1)*log(e)))*cosh(d*c...
 

Sympy [F]

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

integrate((e*x)**(-1+n)*(a+b*csch(c+d*x**n))**2,x)
 

Output:

Integral((e*x)**(n - 1)*(a + b*csch(c + d*x**n))**2, x)
                                                                                    
                                                                                    
 

Maxima [A] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.36 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=-2 \, a b {\left (\frac {e^{n - 1} \log \left ({\left (e^{\left (d x^{n} + c\right )} + 1\right )} e^{\left (-c\right )}\right )}{d n} - \frac {e^{n - 1} \log \left ({\left (e^{\left (d x^{n} + c\right )} - 1\right )} e^{\left (-c\right )}\right )}{d n}\right )} - \frac {2 \, b^{2} e^{n}}{d e n e^{\left (2 \, d x^{n} + 2 \, c\right )} - d e n} + \frac {\left (e x\right )^{n} a^{2}}{e n} \] Input:

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

Output:

-2*a*b*(e^(n - 1)*log((e^(d*x^n + c) + 1)*e^(-c))/(d*n) - e^(n - 1)*log((e 
^(d*x^n + c) - 1)*e^(-c))/(d*n)) - 2*b^2*e^n/(d*e*n*e^(2*d*x^n + 2*c) - d* 
e*n) + (e*x)^n*a^2/(e*n)
 

Giac [F]

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

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

Output:

integrate((b*csch(d*x^n + c) + a)^2*(e*x)^(n - 1), x)
 

Mupad [B] (verification not implemented)

Time = 2.50 (sec) , antiderivative size = 160, normalized size of antiderivative = 2.00 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=\frac {a^2\,x\,{\left (e\,x\right )}^{n-1}}{n}-\frac {4\,\mathrm {atan}\left (\frac {a\,b\,x\,{\mathrm {e}}^{d\,x^n}\,{\mathrm {e}}^c\,{\left (e\,x\right )}^{n-1}\,\sqrt {-d^2\,n^2\,x^{2\,n}}}{d\,n\,x^n\,\sqrt {a^2\,b^2\,x^2\,{\left (e\,x\right )}^{2\,n-2}}}\right )\,\sqrt {a^2\,b^2\,x^2\,{\left (e\,x\right )}^{2\,n-2}}}{\sqrt {-d^2\,n^2\,x^{2\,n}}}-\frac {2\,b^2\,x\,{\left (e\,x\right )}^{n-1}}{d\,n\,x^n\,\left ({\mathrm {e}}^{2\,c+2\,d\,x^n}-1\right )} \] Input:

int((a + b/sinh(c + d*x^n))^2*(e*x)^(n - 1),x)
 

Output:

(a^2*x*(e*x)^(n - 1))/n - (4*atan((a*b*x*exp(d*x^n)*exp(c)*(e*x)^(n - 1)*( 
-d^2*n^2*x^(2*n))^(1/2))/(d*n*x^n*(a^2*b^2*x^2*(e*x)^(2*n - 2))^(1/2)))*(a 
^2*b^2*x^2*(e*x)^(2*n - 2))^(1/2))/(-d^2*n^2*x^(2*n))^(1/2) - (2*b^2*x*(e* 
x)^(n - 1))/(d*n*x^n*(exp(2*c + 2*d*x^n) - 1))
 

Reduce [B] (verification not implemented)

Time = 0.24 (sec) , antiderivative size = 164, normalized size of antiderivative = 2.05 \[ \int (e x)^{-1+n} \left (a+b \text {csch}\left (c+d x^n\right )\right )^2 \, dx=\frac {e^{n} \left (x^{n} e^{2 x^{n} d +2 c} a^{2} d +2 e^{2 x^{n} d +2 c} \mathrm {log}\left (e^{x^{n} d +c}-1\right ) a b -2 e^{2 x^{n} d +2 c} \mathrm {log}\left (e^{x^{n} d +c}+1\right ) a b -2 e^{2 x^{n} d +2 c} b^{2}-x^{n} a^{2} d -2 \,\mathrm {log}\left (e^{x^{n} d +c}-1\right ) a b +2 \,\mathrm {log}\left (e^{x^{n} d +c}+1\right ) a b \right )}{d e n \left (e^{2 x^{n} d +2 c}-1\right )} \] Input:

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

Output:

(e**n*(x**n*e**(2*x**n*d + 2*c)*a**2*d + 2*e**(2*x**n*d + 2*c)*log(e**(x** 
n*d + c) - 1)*a*b - 2*e**(2*x**n*d + 2*c)*log(e**(x**n*d + c) + 1)*a*b - 2 
*e**(2*x**n*d + 2*c)*b**2 - x**n*a**2*d - 2*log(e**(x**n*d + c) - 1)*a*b + 
 2*log(e**(x**n*d + c) + 1)*a*b))/(d*e*n*(e**(2*x**n*d + 2*c) - 1))