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

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

Optimal result

Integrand size = 18, antiderivative size = 217 \[ \int x^5 \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx=\frac {b^2 x^4}{2 d}+\frac {a^2 x^6}{6}+\frac {2 a b x^4 \arctan \left (e^{c+d x^2}\right )}{d}-\frac {b^2 x^2 \log \left (1+e^{2 \left (c+d x^2\right )}\right )}{d^2}-\frac {2 i a b x^2 \operatorname {PolyLog}\left (2,-i e^{c+d x^2}\right )}{d^2}+\frac {2 i a b x^2 \operatorname {PolyLog}\left (2,i e^{c+d x^2}\right )}{d^2}-\frac {b^2 \operatorname {PolyLog}\left (2,-e^{2 \left (c+d x^2\right )}\right )}{2 d^3}+\frac {2 i a b \operatorname {PolyLog}\left (3,-i e^{c+d x^2}\right )}{d^3}-\frac {2 i a b \operatorname {PolyLog}\left (3,i e^{c+d x^2}\right )}{d^3}+\frac {b^2 x^4 \tanh \left (c+d x^2\right )}{2 d} \] Output:

1/2*b^2*x^4/d+1/6*a^2*x^6+2*a*b*x^4*arctan(exp(d*x^2+c))/d-b^2*x^2*ln(1+ex 
p(2*d*x^2+2*c))/d^2-2*I*a*b*x^2*polylog(2,-I*exp(d*x^2+c))/d^2+2*I*a*b*x^2 
*polylog(2,I*exp(d*x^2+c))/d^2-1/2*b^2*polylog(2,-exp(2*d*x^2+2*c))/d^3+2* 
I*a*b*polylog(3,-I*exp(d*x^2+c))/d^3-2*I*a*b*polylog(3,I*exp(d*x^2+c))/d^3 
+1/2*b^2*x^4*tanh(d*x^2+c)/d
 

Mathematica [A] (verified)

Time = 1.75 (sec) , antiderivative size = 320, normalized size of antiderivative = 1.47 \[ \int x^5 \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx=\frac {\cosh \left (c+d x^2\right ) \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \left (a^2 x^6 \cosh \left (c+d x^2\right )+\frac {3 b \cosh \left (c+d x^2\right ) \left (2 b d^2 e^{2 c} x^4-2 b d^2 \left (1+e^{2 c}\right ) x^4+b \left (1+e^{2 c}\right ) \left (2 d x^2 \left (d x^2-\log \left (1+e^{2 \left (c+d x^2\right )}\right )\right )-\operatorname {PolyLog}\left (2,-e^{2 \left (c+d x^2\right )}\right )\right )+2 i a \left (1+e^{2 c}\right ) \left (d^2 x^4 \log \left (1-i e^{c+d x^2}\right )-d^2 x^4 \log \left (1+i e^{c+d x^2}\right )-2 d x^2 \operatorname {PolyLog}\left (2,-i e^{c+d x^2}\right )+2 d x^2 \operatorname {PolyLog}\left (2,i e^{c+d x^2}\right )+2 \operatorname {PolyLog}\left (3,-i e^{c+d x^2}\right )-2 \operatorname {PolyLog}\left (3,i e^{c+d x^2}\right )\right )\right )}{d^3 \left (1+e^{2 c}\right )}+\frac {3 b^2 x^4 \text {sech}(c) \sinh \left (d x^2\right )}{d}\right )}{6 \left (b+a \cosh \left (c+d x^2\right )\right )^2} \] Input:

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

Output:

(Cosh[c + d*x^2]*(a + b*Sech[c + d*x^2])^2*(a^2*x^6*Cosh[c + d*x^2] + (3*b 
*Cosh[c + d*x^2]*(2*b*d^2*E^(2*c)*x^4 - 2*b*d^2*(1 + E^(2*c))*x^4 + b*(1 + 
 E^(2*c))*(2*d*x^2*(d*x^2 - Log[1 + E^(2*(c + d*x^2))]) - PolyLog[2, -E^(2 
*(c + d*x^2))]) + (2*I)*a*(1 + E^(2*c))*(d^2*x^4*Log[1 - I*E^(c + d*x^2)] 
- d^2*x^4*Log[1 + I*E^(c + d*x^2)] - 2*d*x^2*PolyLog[2, (-I)*E^(c + d*x^2) 
] + 2*d*x^2*PolyLog[2, I*E^(c + d*x^2)] + 2*PolyLog[3, (-I)*E^(c + d*x^2)] 
 - 2*PolyLog[3, I*E^(c + d*x^2)])))/(d^3*(1 + E^(2*c))) + (3*b^2*x^4*Sech[ 
c]*Sinh[d*x^2])/d))/(6*(b + a*Cosh[c + d*x^2])^2)
 

Rubi [A] (verified)

Time = 0.85 (sec) , antiderivative size = 213, normalized size of antiderivative = 0.98, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {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 x^5 \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx\)

\(\Big \downarrow \) 5959

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4678

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

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {a^2 x^6}{3}+\frac {4 a b x^4 \arctan \left (e^{c+d x^2}\right )}{d}+\frac {4 i a b \operatorname {PolyLog}\left (3,-i e^{d x^2+c}\right )}{d^3}-\frac {4 i a b \operatorname {PolyLog}\left (3,i e^{d x^2+c}\right )}{d^3}-\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,-i e^{d x^2+c}\right )}{d^2}+\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,i e^{d x^2+c}\right )}{d^2}-\frac {b^2 \operatorname {PolyLog}\left (2,-e^{2 \left (d x^2+c\right )}\right )}{d^3}-\frac {2 b^2 x^2 \log \left (e^{2 \left (c+d x^2\right )}+1\right )}{d^2}+\frac {b^2 x^4 \tanh \left (c+d x^2\right )}{d}+\frac {b^2 x^4}{d}\right )\)

Input:

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

Output:

((b^2*x^4)/d + (a^2*x^6)/3 + (4*a*b*x^4*ArcTan[E^(c + d*x^2)])/d - (2*b^2* 
x^2*Log[1 + E^(2*(c + d*x^2))])/d^2 - ((4*I)*a*b*x^2*PolyLog[2, (-I)*E^(c 
+ d*x^2)])/d^2 + ((4*I)*a*b*x^2*PolyLog[2, I*E^(c + d*x^2)])/d^2 - (b^2*Po 
lyLog[2, -E^(2*(c + d*x^2))])/d^3 + ((4*I)*a*b*PolyLog[3, (-I)*E^(c + d*x^ 
2)])/d^3 - ((4*I)*a*b*PolyLog[3, I*E^(c + d*x^2)])/d^3 + (b^2*x^4*Tanh[c + 
 d*x^2])/d)/2
 

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 4678
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]
 

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]
 
Maple [F]

\[\int x^{5} {\left (a +b \,\operatorname {sech}\left (d \,x^{2}+c \right )\right )}^{2}d x\]

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 1198 vs. \(2 (185) = 370\).

Time = 0.12 (sec) , antiderivative size = 1198, normalized size of antiderivative = 5.52 \[ \int x^5 \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx=\text {Too large to display} \] Input:

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

Output:

1/6*(a^2*d^3*x^6 - 6*b^2*c^2 + (a^2*d^3*x^6 + 6*b^2*d^2*x^4 - 6*b^2*c^2)*c 
osh(d*x^2 + c)^2 + 2*(a^2*d^3*x^6 + 6*b^2*d^2*x^4 - 6*b^2*c^2)*cosh(d*x^2 
+ c)*sinh(d*x^2 + c) + (a^2*d^3*x^6 + 6*b^2*d^2*x^4 - 6*b^2*c^2)*sinh(d*x^ 
2 + c)^2 - 6*(-2*I*a*b*d*x^2 + (-2*I*a*b*d*x^2 + b^2)*cosh(d*x^2 + c)^2 + 
2*(-2*I*a*b*d*x^2 + b^2)*cosh(d*x^2 + c)*sinh(d*x^2 + c) + (-2*I*a*b*d*x^2 
 + b^2)*sinh(d*x^2 + c)^2 + b^2)*dilog(I*cosh(d*x^2 + c) + I*sinh(d*x^2 + 
c)) - 6*(2*I*a*b*d*x^2 + (2*I*a*b*d*x^2 + b^2)*cosh(d*x^2 + c)^2 + 2*(2*I* 
a*b*d*x^2 + b^2)*cosh(d*x^2 + c)*sinh(d*x^2 + c) + (2*I*a*b*d*x^2 + b^2)*s 
inh(d*x^2 + c)^2 + b^2)*dilog(-I*cosh(d*x^2 + c) - I*sinh(d*x^2 + c)) - 6* 
(-I*a*b*c^2 - b^2*c + (-I*a*b*c^2 - b^2*c)*cosh(d*x^2 + c)^2 + 2*(-I*a*b*c 
^2 - b^2*c)*cosh(d*x^2 + c)*sinh(d*x^2 + c) + (-I*a*b*c^2 - b^2*c)*sinh(d* 
x^2 + c)^2)*log(cosh(d*x^2 + c) + sinh(d*x^2 + c) + I) - 6*(I*a*b*c^2 - b^ 
2*c + (I*a*b*c^2 - b^2*c)*cosh(d*x^2 + c)^2 + 2*(I*a*b*c^2 - b^2*c)*cosh(d 
*x^2 + c)*sinh(d*x^2 + c) + (I*a*b*c^2 - b^2*c)*sinh(d*x^2 + c)^2)*log(cos 
h(d*x^2 + c) + sinh(d*x^2 + c) - I) - 6*(I*a*b*d^2*x^4 + b^2*d*x^2 - I*a*b 
*c^2 + b^2*c + (I*a*b*d^2*x^4 + b^2*d*x^2 - I*a*b*c^2 + b^2*c)*cosh(d*x^2 
+ c)^2 + 2*(I*a*b*d^2*x^4 + b^2*d*x^2 - I*a*b*c^2 + b^2*c)*cosh(d*x^2 + c) 
*sinh(d*x^2 + c) + (I*a*b*d^2*x^4 + b^2*d*x^2 - I*a*b*c^2 + b^2*c)*sinh(d* 
x^2 + c)^2)*log(I*cosh(d*x^2 + c) + I*sinh(d*x^2 + c) + 1) - 6*(-I*a*b*d^2 
*x^4 + b^2*d*x^2 + I*a*b*c^2 + b^2*c + (-I*a*b*d^2*x^4 + b^2*d*x^2 + I*...
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

1/6*a^2*x^6 - b^2*x^4/(d*e^(2*d*x^2 + 2*c) + d) + integrate(4*(a*b*d*x^5*e 
^(d*x^2 + c) + b^2*x^3)/(d*e^(2*d*x^2 + 2*c) + d), x)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int x^5 \left (a+b \text {sech}\left (c+d x^2\right )\right )^2 \, dx=\frac {24 e^{2 d \,x^{2}+2 c} \mathit {atan} \left (e^{d \,x^{2}+c}\right ) a b +24 \mathit {atan} \left (e^{d \,x^{2}+c}\right ) a b +48 e^{2 d \,x^{2}+3 c} \left (\int \frac {e^{d \,x^{2}} x^{5}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) a b \,d^{3}+96 e^{2 d \,x^{2}+3 c} \left (\int \frac {e^{d \,x^{2}} x^{3}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) a b \,d^{2}+24 e^{2 d \,x^{2}+2 c} \left (\int \frac {x^{3}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) b^{2} d^{2}-3 e^{2 d \,x^{2}+2 c} \mathrm {log}\left (e^{2 d \,x^{2}+2 c}+1\right ) b^{2}+e^{2 d \,x^{2}+2 c} a^{2} d^{3} x^{6}+6 e^{2 d \,x^{2}+2 c} b^{2} d \,x^{2}-12 e^{d \,x^{2}+c} a b \,d^{2} x^{4}-24 e^{d \,x^{2}+c} a b d \,x^{2}+48 e^{c} \left (\int \frac {e^{d \,x^{2}} x^{5}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) a b \,d^{3}+96 e^{c} \left (\int \frac {e^{d \,x^{2}} x^{3}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) a b \,d^{2}+24 \left (\int \frac {x^{3}}{e^{4 d \,x^{2}+4 c}+2 e^{2 d \,x^{2}+2 c}+1}d x \right ) b^{2} d^{2}-3 \,\mathrm {log}\left (e^{2 d \,x^{2}+2 c}+1\right ) b^{2}+a^{2} d^{3} x^{6}-6 b^{2} d^{2} x^{4}}{6 d^{3} \left (e^{2 d \,x^{2}+2 c}+1\right )} \] Input:

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

Output:

(24*e**(2*c + 2*d*x**2)*atan(e**(c + d*x**2))*a*b + 24*atan(e**(c + d*x**2 
))*a*b + 48*e**(3*c + 2*d*x**2)*int((e**(d*x**2)*x**5)/(e**(4*c + 4*d*x**2 
) + 2*e**(2*c + 2*d*x**2) + 1),x)*a*b*d**3 + 96*e**(3*c + 2*d*x**2)*int((e 
**(d*x**2)*x**3)/(e**(4*c + 4*d*x**2) + 2*e**(2*c + 2*d*x**2) + 1),x)*a*b* 
d**2 + 24*e**(2*c + 2*d*x**2)*int(x**3/(e**(4*c + 4*d*x**2) + 2*e**(2*c + 
2*d*x**2) + 1),x)*b**2*d**2 - 3*e**(2*c + 2*d*x**2)*log(e**(2*c + 2*d*x**2 
) + 1)*b**2 + e**(2*c + 2*d*x**2)*a**2*d**3*x**6 + 6*e**(2*c + 2*d*x**2)*b 
**2*d*x**2 - 12*e**(c + d*x**2)*a*b*d**2*x**4 - 24*e**(c + d*x**2)*a*b*d*x 
**2 + 48*e**c*int((e**(d*x**2)*x**5)/(e**(4*c + 4*d*x**2) + 2*e**(2*c + 2* 
d*x**2) + 1),x)*a*b*d**3 + 96*e**c*int((e**(d*x**2)*x**3)/(e**(4*c + 4*d*x 
**2) + 2*e**(2*c + 2*d*x**2) + 1),x)*a*b*d**2 + 24*int(x**3/(e**(4*c + 4*d 
*x**2) + 2*e**(2*c + 2*d*x**2) + 1),x)*b**2*d**2 - 3*log(e**(2*c + 2*d*x** 
2) + 1)*b**2 + a**2*d**3*x**6 - 6*b**2*d**2*x**4)/(6*d**3*(e**(2*c + 2*d*x 
**2) + 1))