Integrand size = 24, antiderivative size = 208 \[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\frac {a^2 (e x)^{2 n}}{2 e n}+\frac {4 a b x^{-n} (e x)^{2 n} \arctan \left (e^{c+d x^n}\right )}{d e n}-\frac {b^2 x^{-2 n} (e x)^{2 n} \log \left (\cosh \left (c+d x^n\right )\right )}{d^2 e n}-\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-i e^{c+d x^n}\right )}{d^2 e n}+\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,i e^{c+d x^n}\right )}{d^2 e n}+\frac {b^2 x^{-n} (e x)^{2 n} \tanh \left (c+d x^n\right )}{d e n} \] Output:
1/2*a^2*(e*x)^(2*n)/e/n+4*a*b*(e*x)^(2*n)*arctan(exp(c+d*x^n))/d/e/n/(x^n) -b^2*(e*x)^(2*n)*ln(cosh(c+d*x^n))/d^2/e/n/(x^(2*n))-2*I*a*b*(e*x)^(2*n)*p olylog(2,-I*exp(c+d*x^n))/d^2/e/n/(x^(2*n))+2*I*a*b*(e*x)^(2*n)*polylog(2, I*exp(c+d*x^n))/d^2/e/n/(x^(2*n))+b^2*(e*x)^(2*n)*tanh(c+d*x^n)/d/e/n/(x^n )
Leaf count is larger than twice the leaf count of optimal. \(501\) vs. \(2(208)=416\).
Time = 3.50 (sec) , antiderivative size = 501, normalized size of antiderivative = 2.41 \[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\frac {x^{-2 n} (e x)^{2 n} \text {csch}^5(c) \text {sech}\left (c+d x^n\right ) \left (-2 b^2 d x^n \cosh \left (d x^n\right ) \sqrt {-\text {csch}^2(c)}+2 b^2 d x^n \cosh \left (2 c+d x^n\right ) \sqrt {-\text {csch}^2(c)}+8 a b d x^n \cosh \left (c+d x^n\right ) \log \left (1-e^{-d x^n-\text {arctanh}(\coth (c))}\right )+8 a b \text {arctanh}(\coth (c)) \cosh \left (c+d x^n\right ) \log \left (1-e^{-d x^n-\text {arctanh}(\coth (c))}\right )-8 a b d x^n \cosh \left (c+d x^n\right ) \log \left (1+e^{-d x^n-\text {arctanh}(\coth (c))}\right )-8 a b \text {arctanh}(\coth (c)) \cosh \left (c+d x^n\right ) \log \left (1+e^{-d x^n-\text {arctanh}(\coth (c))}\right )+8 a b \cosh \left (c+d x^n\right ) \operatorname {PolyLog}\left (2,-e^{-d x^n-\text {arctanh}(\coth (c))}\right )-8 a b \cosh \left (c+d x^n\right ) \operatorname {PolyLog}\left (2,e^{-d x^n-\text {arctanh}(\coth (c))}\right )-a^2 d^2 x^{2 n} \sqrt {-\text {csch}^2(c)} \sinh \left (d x^n\right )+8 a b \arctan \left (\sinh (c)+\cosh (c) \tanh \left (\frac {d x^n}{2}\right )\right ) \text {arctanh}(\coth (c)) \sqrt {-\text {csch}^2(c)} \sinh \left (d x^n\right )+2 b^2 \sqrt {-\text {csch}^2(c)} \log \left (\cosh \left (c+d x^n\right )\right ) \sinh \left (d x^n\right )+a^2 d^2 x^{2 n} \sqrt {-\text {csch}^2(c)} \sinh \left (2 c+d x^n\right )-8 a b \arctan \left (\sinh (c)+\cosh (c) \tanh \left (\frac {d x^n}{2}\right )\right ) \text {arctanh}(\coth (c)) \sqrt {-\text {csch}^2(c)} \sinh \left (2 c+d x^n\right )-2 b^2 \sqrt {-\text {csch}^2(c)} \log \left (\cosh \left (c+d x^n\right )\right ) \sinh \left (2 c+d x^n\right )\right )}{4 d^2 e n \left (-\text {csch}^2(c)\right )^{5/2}} \] Input:
Integrate[(e*x)^(-1 + 2*n)*(a + b*Sech[c + d*x^n])^2,x]
Output:
((e*x)^(2*n)*Csch[c]^5*Sech[c + d*x^n]*(-2*b^2*d*x^n*Cosh[d*x^n]*Sqrt[-Csc h[c]^2] + 2*b^2*d*x^n*Cosh[2*c + d*x^n]*Sqrt[-Csch[c]^2] + 8*a*b*d*x^n*Cos h[c + d*x^n]*Log[1 - E^(-(d*x^n) - ArcTanh[Coth[c]])] + 8*a*b*ArcTanh[Coth [c]]*Cosh[c + d*x^n]*Log[1 - E^(-(d*x^n) - ArcTanh[Coth[c]])] - 8*a*b*d*x^ n*Cosh[c + d*x^n]*Log[1 + E^(-(d*x^n) - ArcTanh[Coth[c]])] - 8*a*b*ArcTanh [Coth[c]]*Cosh[c + d*x^n]*Log[1 + E^(-(d*x^n) - ArcTanh[Coth[c]])] + 8*a*b *Cosh[c + d*x^n]*PolyLog[2, -E^(-(d*x^n) - ArcTanh[Coth[c]])] - 8*a*b*Cosh [c + d*x^n]*PolyLog[2, E^(-(d*x^n) - ArcTanh[Coth[c]])] - a^2*d^2*x^(2*n)* Sqrt[-Csch[c]^2]*Sinh[d*x^n] + 8*a*b*ArcTan[Sinh[c] + Cosh[c]*Tanh[(d*x^n) /2]]*ArcTanh[Coth[c]]*Sqrt[-Csch[c]^2]*Sinh[d*x^n] + 2*b^2*Sqrt[-Csch[c]^2 ]*Log[Cosh[c + d*x^n]]*Sinh[d*x^n] + a^2*d^2*x^(2*n)*Sqrt[-Csch[c]^2]*Sinh [2*c + d*x^n] - 8*a*b*ArcTan[Sinh[c] + Cosh[c]*Tanh[(d*x^n)/2]]*ArcTanh[Co th[c]]*Sqrt[-Csch[c]^2]*Sinh[2*c + d*x^n] - 2*b^2*Sqrt[-Csch[c]^2]*Log[Cos h[c + d*x^n]]*Sinh[2*c + d*x^n]))/(4*d^2*e*n*x^(2*n)*(-Csch[c]^2)^(5/2))
Time = 0.52 (sec) , antiderivative size = 135, normalized size of antiderivative = 0.65, 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, 4678, 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 (e x)^{2 n-1} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 5963 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^{2 n-1} \left (a+b \text {sech}\left (d x^n+c\right )\right )^2dx}{e}\) |
\(\Big \downarrow \) 5959 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \text {sech}\left (d x^n+c\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \csc \left (i d x^n+i c+\frac {\pi }{2}\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 4678 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int \left (a^2 x^n+b^2 \text {sech}^2\left (d x^n+c\right ) x^n+2 a b \text {sech}\left (d x^n+c\right ) x^n\right )dx^n}{e n}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \left (\frac {1}{2} a^2 x^{2 n}+\frac {4 a b x^n \arctan \left (e^{c+d x^n}\right )}{d}-\frac {2 i a b \operatorname {PolyLog}\left (2,-i e^{d x^n+c}\right )}{d^2}+\frac {2 i a b \operatorname {PolyLog}\left (2,i e^{d x^n+c}\right )}{d^2}-\frac {b^2 \log \left (\cosh \left (c+d x^n\right )\right )}{d^2}+\frac {b^2 x^n \tanh \left (c+d x^n\right )}{d}\right )}{e n}\) |
Input:
Int[(e*x)^(-1 + 2*n)*(a + b*Sech[c + d*x^n])^2,x]
Output:
((e*x)^(2*n)*((a^2*x^(2*n))/2 + (4*a*b*x^n*ArcTan[E^(c + d*x^n)])/d - (b^2 *Log[Cosh[c + d*x^n]])/d^2 - ((2*I)*a*b*PolyLog[2, (-I)*E^(c + d*x^n)])/d^ 2 + ((2*I)*a*b*PolyLog[2, I*E^(c + d*x^n)])/d^2 + (b^2*x^n*Tanh[c + d*x^n] )/d))/(e*n*x^(2*n))
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
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]
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]
\[\int \left (e x \right )^{-1+2 n} {\left (a +b \,\operatorname {sech}\left (c +d \,x^{n}\right )\right )}^{2}d x\]
Input:
int((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x)
Output:
int((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x)
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 2972 vs. \(2 (199) = 398\).
Time = 0.18 (sec) , antiderivative size = 2972, normalized size of antiderivative = 14.29 \[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\text {Too large to display} \] Input:
integrate((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x, algorithm="fricas")
Output:
1/2*(a^2*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x))^2 + 4*b^2*c*cosh((2*n - 1)*log(e)) + (a^2*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x))^2 + 4*b^2*d*c osh((2*n - 1)*log(e))*cosh(n*log(x)) + 4*b^2*c*cosh((2*n - 1)*log(e)) + (a ^2*d^2*cosh((2*n - 1)*log(e)) + a^2*d^2*sinh((2*n - 1)*log(e)))*sinh(n*log (x))^2 + (a^2*d^2*cosh(n*log(x))^2 + 4*b^2*d*cosh(n*log(x)) + 4*b^2*c)*sin h((2*n - 1)*log(e)) + 2*(a^2*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x)) + 2 *b^2*d*cosh((2*n - 1)*log(e)) + (a^2*d^2*cosh(n*log(x)) + 2*b^2*d)*sinh((2 *n - 1)*log(e)))*sinh(n*log(x)))*cosh(d*cosh(n*log(x)) + d*sinh(n*log(x)) + c)^2 + 2*(a^2*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x))^2 + 4*b^2*d*cosh ((2*n - 1)*log(e))*cosh(n*log(x)) + 4*b^2*c*cosh((2*n - 1)*log(e)) + (a^2* d^2*cosh((2*n - 1)*log(e)) + a^2*d^2*sinh((2*n - 1)*log(e)))*sinh(n*log(x) )^2 + (a^2*d^2*cosh(n*log(x))^2 + 4*b^2*d*cosh(n*log(x)) + 4*b^2*c)*sinh(( 2*n - 1)*log(e)) + 2*(a^2*d^2*cosh((2*n - 1)*log(e))*cosh(n*log(x)) + 2*b^ 2*d*cosh((2*n - 1)*log(e)) + (a^2*d^2*cosh(n*log(x)) + 2*b^2*d)*sinh((2*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^2*cosh((2*n - 1)* log(e))*cosh(n*log(x))^2 + 4*b^2*d*cosh((2*n - 1)*log(e))*cosh(n*log(x)) + 4*b^2*c*cosh((2*n - 1)*log(e)) + (a^2*d^2*cosh((2*n - 1)*log(e)) + a^2*d^ 2*sinh((2*n - 1)*log(e)))*sinh(n*log(x))^2 + (a^2*d^2*cosh(n*log(x))^2 + 4 *b^2*d*cosh(n*log(x)) + 4*b^2*c)*sinh((2*n - 1)*log(e)) + 2*(a^2*d^2*co...
\[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\int \left (e x\right )^{2 n - 1} \left (a + b \operatorname {sech}{\left (c + d x^{n} \right )}\right )^{2}\, dx \] Input:
integrate((e*x)**(-1+2*n)*(a+b*sech(c+d*x**n))**2,x)
Output:
Integral((e*x)**(2*n - 1)*(a + b*sech(c + d*x**n))**2, x)
\[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \operatorname {sech}\left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \] Input:
integrate((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x, algorithm="maxima")
Output:
4*a*b*e^(2*n)*integrate(e^(d*x^n + 2*n*log(x) + c)/(e*x*e^(2*d*x^n + 2*c) + e*x), x) + b^2*(2*e^(2*n)*e^(2*d*x^n + n*log(x) + 2*c)/(d*e*n*e^(2*d*x^n + 2*c) + d*e*n) - e^(2*n - 1)*log((e^(2*d*x^n + 2*c) + 1)*e^(-2*c))/(d^2* n)) + 1/2*(e*x)^(2*n)*a^2/(e*n)
\[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \operatorname {sech}\left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \] Input:
integrate((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x, algorithm="giac")
Output:
integrate((b*sech(d*x^n + c) + a)^2*(e*x)^(2*n - 1), x)
Timed out. \[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\int {\left (a+\frac {b}{\mathrm {cosh}\left (c+d\,x^n\right )}\right )}^2\,{\left (e\,x\right )}^{2\,n-1} \,d x \] Input:
int((a + b/cosh(c + d*x^n))^2*(e*x)^(2*n - 1),x)
Output:
int((a + b/cosh(c + d*x^n))^2*(e*x)^(2*n - 1), x)
\[ \int (e x)^{-1+2 n} \left (a+b \text {sech}\left (c+d x^n\right )\right )^2 \, dx=\frac {e^{2 n} \left (8 e^{2 x^{n} d +2 c} \mathit {atan} \left (e^{x^{n} d +c}\right ) a b +8 \mathit {atan} \left (e^{x^{n} d +c}\right ) a b +16 e^{2 x^{n} d +3 c} \left (\int \frac {x^{2 n} e^{x^{n} d}}{e^{4 x^{n} d +4 c} x +2 e^{2 x^{n} d +2 c} x +x}d x \right ) a b \,d^{2} n +x^{2 n} e^{2 x^{n} d +2 c} a^{2} d^{2}+4 x^{n} e^{2 x^{n} d +2 c} b^{2} d -2 e^{2 x^{n} d +2 c} \mathrm {log}\left (e^{2 x^{n} d +2 c}+1\right ) b^{2}-8 x^{n} e^{x^{n} d +c} a b d +16 e^{c} \left (\int \frac {x^{2 n} e^{x^{n} d}}{e^{4 x^{n} d +4 c} x +2 e^{2 x^{n} d +2 c} x +x}d x \right ) a b \,d^{2} n +x^{2 n} a^{2} d^{2}-2 \,\mathrm {log}\left (e^{2 x^{n} d +2 c}+1\right ) b^{2}\right )}{2 d^{2} e n \left (e^{2 x^{n} d +2 c}+1\right )} \] Input:
int((e*x)^(-1+2*n)*(a+b*sech(c+d*x^n))^2,x)
Output:
(e**(2*n)*(8*e**(2*x**n*d + 2*c)*atan(e**(x**n*d + c))*a*b + 8*atan(e**(x* *n*d + c))*a*b + 16*e**(2*x**n*d + 3*c)*int((x**(2*n)*e**(x**n*d))/(e**(4* x**n*d + 4*c)*x + 2*e**(2*x**n*d + 2*c)*x + x),x)*a*b*d**2*n + x**(2*n)*e* *(2*x**n*d + 2*c)*a**2*d**2 + 4*x**n*e**(2*x**n*d + 2*c)*b**2*d - 2*e**(2* x**n*d + 2*c)*log(e**(2*x**n*d + 2*c) + 1)*b**2 - 8*x**n*e**(x**n*d + c)*a *b*d + 16*e**c*int((x**(2*n)*e**(x**n*d))/(e**(4*x**n*d + 4*c)*x + 2*e**(2 *x**n*d + 2*c)*x + x),x)*a*b*d**2*n + x**(2*n)*a**2*d**2 - 2*log(e**(2*x** n*d + 2*c) + 1)*b**2))/(2*d**2*e*n*(e**(2*x**n*d + 2*c) + 1))