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

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

Optimal result

Integrand size = 24, antiderivative size = 307 \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\frac {(e x)^{2 n}}{2 a e n}-\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}+\frac {b x^{-n} (e x)^{2 n} \log \left (1+\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d e n}-\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b-\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n}+\frac {b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-\frac {a e^{c+d x^n}}{b+\sqrt {-a^2+b^2}}\right )}{a \sqrt {-a^2+b^2} d^2 e n} \] Output:

1/2*(e*x)^(2*n)/a/e/n-b*(e*x)^(2*n)*ln(1+a*exp(c+d*x^n)/(b-(-a^2+b^2)^(1/2 
)))/a/(-a^2+b^2)^(1/2)/d/e/n/(x^n)+b*(e*x)^(2*n)*ln(1+a*exp(c+d*x^n)/(b+(- 
a^2+b^2)^(1/2)))/a/(-a^2+b^2)^(1/2)/d/e/n/(x^n)-b*(e*x)^(2*n)*polylog(2,-a 
*exp(c+d*x^n)/(b-(-a^2+b^2)^(1/2)))/a/(-a^2+b^2)^(1/2)/d^2/e/n/(x^(2*n))+b 
*(e*x)^(2*n)*polylog(2,-a*exp(c+d*x^n)/(b+(-a^2+b^2)^(1/2)))/a/(-a^2+b^2)^ 
(1/2)/d^2/e/n/(x^(2*n))
 

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

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

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

Output:

((e*x)^(2*n)*(b + a*Cosh[c + d*x^n])*(1 + (2*b*(2*(c + d*x^n)*ArcTan[((a + 
 b)*Coth[(c + d*x^n)/2])/Sqrt[a^2 - b^2]] + 2*(c - I*ArcCos[-(b/a)])*ArcTa 
n[((a - b)*Tanh[(c + d*x^n)/2])/Sqrt[a^2 - b^2]] + (ArcCos[-(b/a)] + 2*(Ar 
cTan[((a + b)*Coth[(c + d*x^n)/2])/Sqrt[a^2 - b^2]] + ArcTan[((a - b)*Tanh 
[(c + d*x^n)/2])/Sqrt[a^2 - b^2]]))*Log[(Sqrt[a^2 - b^2]*E^(-1/2*c - (d*x^ 
n)/2))/(Sqrt[2]*Sqrt[a]*Sqrt[b + a*Cosh[c + d*x^n]])] + (ArcCos[-(b/a)] - 
2*(ArcTan[((a + b)*Coth[(c + d*x^n)/2])/Sqrt[a^2 - b^2]] + ArcTan[((a - b) 
*Tanh[(c + d*x^n)/2])/Sqrt[a^2 - b^2]]))*Log[(Sqrt[a^2 - b^2]*E^((c + d*x^ 
n)/2))/(Sqrt[2]*Sqrt[a]*Sqrt[b + a*Cosh[c + d*x^n]])] - (ArcCos[-(b/a)] + 
2*ArcTan[((a - b)*Tanh[(c + d*x^n)/2])/Sqrt[a^2 - b^2]])*Log[((a + b)*(-a 
+ b + I*Sqrt[a^2 - b^2])*(-1 + Tanh[(c + d*x^n)/2]))/(a*(a + b + I*Sqrt[a^ 
2 - b^2]*Tanh[(c + d*x^n)/2]))] - (ArcCos[-(b/a)] - 2*ArcTan[((a - b)*Tanh 
[(c + d*x^n)/2])/Sqrt[a^2 - b^2]])*Log[((a + b)*(a - b + I*Sqrt[a^2 - b^2] 
)*(1 + Tanh[(c + d*x^n)/2]))/(a*(a + b + I*Sqrt[a^2 - b^2]*Tanh[(c + d*x^n 
)/2]))] + I*(PolyLog[2, ((b - I*Sqrt[a^2 - b^2])*(a + b - I*Sqrt[a^2 - b^2 
]*Tanh[(c + d*x^n)/2]))/(a*(a + b + I*Sqrt[a^2 - b^2]*Tanh[(c + d*x^n)/2]) 
)] - PolyLog[2, ((b + I*Sqrt[a^2 - b^2])*(a + b - I*Sqrt[a^2 - b^2]*Tanh[( 
c + d*x^n)/2]))/(a*(a + b + I*Sqrt[a^2 - b^2]*Tanh[(c + d*x^n)/2]))])))/(S 
qrt[a^2 - b^2]*d^2*x^(2*n)))*Sech[c + d*x^n])/(2*a*e*n*(a + b*Sech[c + d*x 
^n]))
 

Rubi [A] (verified)

Time = 0.91 (sec) , antiderivative size = 252, normalized size of antiderivative = 0.82, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {5963, 5959, 3042, 4679, 2009}

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

\(\Big \downarrow \) 5963

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

\(\Big \downarrow \) 5959

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4679

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \left (-\frac {b \operatorname {PolyLog}\left (2,-\frac {a e^{d x^n+c}}{b-\sqrt {b^2-a^2}}\right )}{a d^2 \sqrt {b^2-a^2}}+\frac {b \operatorname {PolyLog}\left (2,-\frac {a e^{d x^n+c}}{b+\sqrt {b^2-a^2}}\right )}{a d^2 \sqrt {b^2-a^2}}-\frac {b x^n \log \left (\frac {a e^{c+d x^n}}{b-\sqrt {b^2-a^2}}+1\right )}{a d \sqrt {b^2-a^2}}+\frac {b x^n \log \left (\frac {a e^{c+d x^n}}{\sqrt {b^2-a^2}+b}+1\right )}{a d \sqrt {b^2-a^2}}+\frac {x^{2 n}}{2 a}\right )}{e n}\)

Input:

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

Output:

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

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4679
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) 
, x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, 1/(Sin[e + f*x]^n/(b + a*Si 
n[e + f*x])^n), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && ILtQ[n, 0] && IGt 
Q[m, 0]
 

rule 5959
Int[(x_)^(m_.)*((a_.) + (b_.)*Sech[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbo 
l] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sech[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 5963
Int[((e_)*(x_))^(m_.)*((a_.) + (b_.)*Sech[(c_.) + (d_.)*(x_)^(n_)])^(p_.), 
x_Symbol] :> Simp[e^IntPart[m]*((e*x)^FracPart[m]/x^FracPart[m])   Int[x^m* 
(a + b*Sech[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 4.

Time = 0.68 (sec) , antiderivative size = 585, normalized size of antiderivative = 1.91

method result size
risch \(\frac {x \,{\mathrm e}^{\frac {\left (-1+2 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}}}{2 a n}-\frac {2 b \,{\mathrm e}^{-i \pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )} {\mathrm e}^{i \pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2}} {\mathrm e}^{i \pi n \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2}} {\mathrm e}^{-i \pi n \operatorname {csgn}\left (i e x \right )^{3}} {\mathrm e}^{\frac {i \pi \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )}{2}} {\mathrm e}^{-\frac {i \pi \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2}}{2}} {\mathrm e}^{-\frac {i \pi \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2}}{2}} {\mathrm e}^{\frac {i \pi \operatorname {csgn}\left (i e x \right )^{3}}{2}} e^{2 n} {\mathrm e}^{c} \left (\frac {x^{n} d \left (\ln \left (\frac {-a \,{\mathrm e}^{2 c +d \,x^{n}}-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )-\ln \left (\frac {a \,{\mathrm e}^{2 c +d \,x^{n}}+{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )\right )}{2 \sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}+\frac {\operatorname {dilog}\left (\frac {-a \,{\mathrm e}^{2 c +d \,x^{n}}-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{-{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )-\operatorname {dilog}\left (\frac {a \,{\mathrm e}^{2 c +d \,x^{n}}+{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}{{\mathrm e}^{c} b +\sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )}{2 \sqrt {{\mathrm e}^{2 c} b^{2}-a^{2} {\mathrm e}^{2 c}}}\right )}{a e n \,d^{2}}\) \(585\)

Input:

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

Output:

1/2/a/n*x*exp(1/2*(-1+2*n)*(-I*Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+I*Pi*csg 
n(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*b/a*exp(-I*Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x))*exp(I*Pi*n 
*csgn(I*e)*csgn(I*e*x)^2)*exp(I*Pi*n*csgn(I*x)*csgn(I*e*x)^2)*exp(-I*Pi*n* 
csgn(I*e*x)^3)*exp(1/2*I*Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x))*exp(-1/2*I*Pi 
*csgn(I*e)*csgn(I*e*x)^2)*exp(-1/2*I*Pi*csgn(I*x)*csgn(I*e*x)^2)*exp(1/2*I 
*Pi*csgn(I*e*x)^3)*(e^n)^2/e*exp(c)/n/d^2*(1/2*x^n*d*(ln((-a*exp(2*c+d*x^n 
)-exp(c)*b+(exp(2*c)*b^2-a^2*exp(2*c))^(1/2))/(-exp(c)*b+(exp(2*c)*b^2-a^2 
*exp(2*c))^(1/2)))-ln((a*exp(2*c+d*x^n)+exp(c)*b+(exp(2*c)*b^2-a^2*exp(2*c 
))^(1/2))/(exp(c)*b+(exp(2*c)*b^2-a^2*exp(2*c))^(1/2))))/(exp(2*c)*b^2-a^2 
*exp(2*c))^(1/2)+1/2*(dilog((-a*exp(2*c+d*x^n)-exp(c)*b+(exp(2*c)*b^2-a^2* 
exp(2*c))^(1/2))/(-exp(c)*b+(exp(2*c)*b^2-a^2*exp(2*c))^(1/2)))-dilog((a*e 
xp(2*c+d*x^n)+exp(c)*b+(exp(2*c)*b^2-a^2*exp(2*c))^(1/2))/(exp(c)*b+(exp(2 
*c)*b^2-a^2*exp(2*c))^(1/2))))/(exp(2*c)*b^2-a^2*exp(2*c))^(1/2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1286 vs. \(2 (287) = 574\).

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

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

Output:

1/2*((a^2 - b^2)*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x))^2 + (a^2 - b^2) 
*d^2*cosh(n*log(x))^2*sinh((2*n - 1)*log(e)) + ((a^2 - b^2)*d^2*cosh((2*n 
- 1)*log(e)) + (a^2 - b^2)*d^2*sinh((2*n - 1)*log(e)))*sinh(n*log(x))^2 + 
2*(a*b*sqrt(-(a^2 - b^2)/a^2)*cosh((2*n - 1)*log(e)) + a*b*sqrt(-(a^2 - b^ 
2)/a^2)*sinh((2*n - 1)*log(e)))*dilog(-((a*sqrt(-(a^2 - b^2)/a^2) + b)*cos 
h(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c) + (a*sqrt(-(a^2 - b^2)/a^2) + b 
)*sinh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c) + a)/a + 1) - 2*(a*b*sqrt( 
-(a^2 - b^2)/a^2)*cosh((2*n - 1)*log(e)) + a*b*sqrt(-(a^2 - b^2)/a^2)*sinh 
((2*n - 1)*log(e)))*dilog(((a*sqrt(-(a^2 - b^2)/a^2) - b)*cosh(d*cosh(n*lo 
g(x)) + d*sinh(n*log(x)) + c) + (a*sqrt(-(a^2 - b^2)/a^2) - b)*sinh(d*cosh 
(n*log(x)) + d*sinh(n*log(x)) + c) - a)/a + 1) + 2*(a*b*c*sqrt(-(a^2 - b^2 
)/a^2)*cosh((2*n - 1)*log(e)) + a*b*c*sqrt(-(a^2 - b^2)/a^2)*sinh((2*n - 1 
)*log(e)))*log(2*a*cosh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c) + 2*a*sin 
h(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c) + 2*a*sqrt(-(a^2 - b^2)/a^2) + 
2*b) - 2*(a*b*c*sqrt(-(a^2 - b^2)/a^2)*cosh((2*n - 1)*log(e)) + a*b*c*sqrt 
(-(a^2 - b^2)/a^2)*sinh((2*n - 1)*log(e)))*log(2*a*cosh(d*cosh(n*log(x)) + 
 d*sinh(n*log(x)) + c) + 2*a*sinh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c) 
 - 2*a*sqrt(-(a^2 - b^2)/a^2) + 2*b) + 2*(a*b*d*sqrt(-(a^2 - b^2)/a^2)*cos 
h((2*n - 1)*log(e))*cosh(n*log(x)) + a*b*c*sqrt(-(a^2 - b^2)/a^2)*cosh((2* 
n - 1)*log(e)) + (a*b*d*sqrt(-(a^2 - b^2)/a^2)*cosh(n*log(x)) + a*b*c*s...
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \frac {(e x)^{-1+2 n}}{a+b \text {sech}\left (c+d x^n\right )} \, dx=\int \frac {{\left (e\,x\right )}^{2\,n-1}}{a+\frac {b}{\mathrm {cosh}\left (c+d\,x^n\right )}} \,d x \] Input:

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

Output:

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

Reduce [F]

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

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

Output:

(e**(2*n)*(e**(2*c)*int((x**(2*n)*e**(2*x**n*d))/(e**(2*x**n*d + 2*c)*a*x 
+ 2*e**(x**n*d + c)*b*x + a*x),x) + int(x**(2*n)/(e**(2*x**n*d + 2*c)*a*x 
+ 2*e**(x**n*d + c)*b*x + a*x),x)))/e