\(\int x^5 (a+b \csc (c+d x^2))^2 \, dx\) [8]

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

Optimal result

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

-1/2*I*b^2*x^4/d+1/6*a^2*x^6-2*a*b*x^4*arctanh(exp(I*(d*x^2+c)))/d-1/2*b^2 
*x^4*cot(d*x^2+c)/d+b^2*x^2*ln(1-exp(2*I*(d*x^2+c)))/d^2+2*I*a*b*x^2*polyl 
og(2,-exp(I*(d*x^2+c)))/d^2-2*I*a*b*x^2*polylog(2,exp(I*(d*x^2+c)))/d^2-1/ 
2*I*b^2*polylog(2,exp(2*I*(d*x^2+c)))/d^3-2*a*b*polylog(3,-exp(I*(d*x^2+c) 
))/d^3+2*a*b*polylog(3,exp(I*(d*x^2+c)))/d^3
 

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(639\) vs. \(2(228)=456\).

Time = 2.24 (sec) , antiderivative size = 639, normalized size of antiderivative = 2.80 \[ \int x^5 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx=\frac {-12 i b^2 d^2 x^4-2 a^2 d^3 x^6+2 a^2 d^3 e^{2 i c} x^6-12 b^2 d x^2 \log \left (1-e^{-i \left (c+d x^2\right )}\right )+12 b^2 d e^{2 i c} x^2 \log \left (1-e^{-i \left (c+d x^2\right )}\right )-12 a b d^2 x^4 \log \left (1-e^{-i \left (c+d x^2\right )}\right )+12 a b d^2 e^{2 i c} x^4 \log \left (1-e^{-i \left (c+d x^2\right )}\right )-12 b^2 d x^2 \log \left (1+e^{-i \left (c+d x^2\right )}\right )+12 b^2 d e^{2 i c} x^2 \log \left (1+e^{-i \left (c+d x^2\right )}\right )+12 a b d^2 x^4 \log \left (1+e^{-i \left (c+d x^2\right )}\right )-12 a b d^2 e^{2 i c} x^4 \log \left (1+e^{-i \left (c+d x^2\right )}\right )+12 i b \left (-1+e^{2 i c}\right ) \left (b-2 a d x^2\right ) \operatorname {PolyLog}\left (2,-e^{-i \left (c+d x^2\right )}\right )+12 i b \left (-1+e^{2 i c}\right ) \left (b+2 a d x^2\right ) \operatorname {PolyLog}\left (2,e^{-i \left (c+d x^2\right )}\right )+24 a b \operatorname {PolyLog}\left (3,-e^{-i \left (c+d x^2\right )}\right )-24 a b e^{2 i c} \operatorname {PolyLog}\left (3,-e^{-i \left (c+d x^2\right )}\right )-24 a b \operatorname {PolyLog}\left (3,e^{-i \left (c+d x^2\right )}\right )+24 a b e^{2 i c} \operatorname {PolyLog}\left (3,e^{-i \left (c+d x^2\right )}\right )-3 b^2 d^2 x^4 \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} \left (c+d x^2\right )\right ) \sin \left (\frac {d x^2}{2}\right )+3 b^2 d^2 e^{2 i c} x^4 \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} \left (c+d x^2\right )\right ) \sin \left (\frac {d x^2}{2}\right )-3 b^2 d^2 x^4 \sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} \left (c+d x^2\right )\right ) \sin \left (\frac {d x^2}{2}\right )+3 b^2 d^2 e^{2 i c} x^4 \sec \left (\frac {c}{2}\right ) \sec \left (\frac {1}{2} \left (c+d x^2\right )\right ) \sin \left (\frac {d x^2}{2}\right )}{12 d^3 \left (-1+e^{2 i c}\right )} \] Input:

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

Output:

((-12*I)*b^2*d^2*x^4 - 2*a^2*d^3*x^6 + 2*a^2*d^3*E^((2*I)*c)*x^6 - 12*b^2* 
d*x^2*Log[1 - E^((-I)*(c + d*x^2))] + 12*b^2*d*E^((2*I)*c)*x^2*Log[1 - E^( 
(-I)*(c + d*x^2))] - 12*a*b*d^2*x^4*Log[1 - E^((-I)*(c + d*x^2))] + 12*a*b 
*d^2*E^((2*I)*c)*x^4*Log[1 - E^((-I)*(c + d*x^2))] - 12*b^2*d*x^2*Log[1 + 
E^((-I)*(c + d*x^2))] + 12*b^2*d*E^((2*I)*c)*x^2*Log[1 + E^((-I)*(c + d*x^ 
2))] + 12*a*b*d^2*x^4*Log[1 + E^((-I)*(c + d*x^2))] - 12*a*b*d^2*E^((2*I)* 
c)*x^4*Log[1 + E^((-I)*(c + d*x^2))] + (12*I)*b*(-1 + E^((2*I)*c))*(b - 2* 
a*d*x^2)*PolyLog[2, -E^((-I)*(c + d*x^2))] + (12*I)*b*(-1 + E^((2*I)*c))*( 
b + 2*a*d*x^2)*PolyLog[2, E^((-I)*(c + d*x^2))] + 24*a*b*PolyLog[3, -E^((- 
I)*(c + d*x^2))] - 24*a*b*E^((2*I)*c)*PolyLog[3, -E^((-I)*(c + d*x^2))] - 
24*a*b*PolyLog[3, E^((-I)*(c + d*x^2))] + 24*a*b*E^((2*I)*c)*PolyLog[3, E^ 
((-I)*(c + d*x^2))] - 3*b^2*d^2*x^4*Csc[c/2]*Csc[(c + d*x^2)/2]*Sin[(d*x^2 
)/2] + 3*b^2*d^2*E^((2*I)*c)*x^4*Csc[c/2]*Csc[(c + d*x^2)/2]*Sin[(d*x^2)/2 
] - 3*b^2*d^2*x^4*Sec[c/2]*Sec[(c + d*x^2)/2]*Sin[(d*x^2)/2] + 3*b^2*d^2*E 
^((2*I)*c)*x^4*Sec[c/2]*Sec[(c + d*x^2)/2]*Sin[(d*x^2)/2])/(12*d^3*(-1 + E 
^((2*I)*c)))
 

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 227, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {4693, 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 \csc \left (c+d x^2\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4693

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4678

\(\displaystyle \frac {1}{2} \int \left (a^2 x^4+b^2 \csc ^2\left (d x^2+c\right ) x^4+2 a b \csc \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 \text {arctanh}\left (e^{i \left (c+d x^2\right )}\right )}{d}-\frac {4 a b \operatorname {PolyLog}\left (3,-e^{i \left (d x^2+c\right )}\right )}{d^3}+\frac {4 a b \operatorname {PolyLog}\left (3,e^{i \left (d x^2+c\right )}\right )}{d^3}+\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,-e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {4 i a b x^2 \operatorname {PolyLog}\left (2,e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {i b^2 \operatorname {PolyLog}\left (2,e^{2 i \left (d x^2+c\right )}\right )}{d^3}+\frac {2 b^2 x^2 \log \left (1-e^{2 i \left (c+d x^2\right )}\right )}{d^2}-\frac {b^2 x^4 \cot \left (c+d x^2\right )}{d}-\frac {i b^2 x^4}{d}\right )\)

Input:

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

Output:

(((-I)*b^2*x^4)/d + (a^2*x^6)/3 - (4*a*b*x^4*ArcTanh[E^(I*(c + d*x^2))])/d 
 - (b^2*x^4*Cot[c + d*x^2])/d + (2*b^2*x^2*Log[1 - E^((2*I)*(c + d*x^2))]) 
/d^2 + ((4*I)*a*b*x^2*PolyLog[2, -E^(I*(c + d*x^2))])/d^2 - ((4*I)*a*b*x^2 
*PolyLog[2, E^(I*(c + d*x^2))])/d^2 - (I*b^2*PolyLog[2, E^((2*I)*(c + d*x^ 
2))])/d^3 - (4*a*b*PolyLog[3, -E^(I*(c + d*x^2))])/d^3 + (4*a*b*PolyLog[3, 
 E^(I*(c + d*x^2))])/d^3)/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 4693
Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol 
] :> Simp[1/n   Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Csc[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 \csc \left (d \,x^{2}+c \right )\right )}^{2}d x\]

Input:

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

Output:

int(x^5*(a+b*csc(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. 687 vs. \(2 (195) = 390\).

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

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

Output:

1/6*(a^2*d^3*x^6*sin(d*x^2 + c) - 3*b^2*d^2*x^4*cos(d*x^2 + c) + 6*a*b*pol 
ylog(3, cos(d*x^2 + c) + I*sin(d*x^2 + c))*sin(d*x^2 + c) + 6*a*b*polylog( 
3, cos(d*x^2 + c) - I*sin(d*x^2 + c))*sin(d*x^2 + c) - 6*a*b*polylog(3, -c 
os(d*x^2 + c) + I*sin(d*x^2 + c))*sin(d*x^2 + c) - 6*a*b*polylog(3, -cos(d 
*x^2 + c) - I*sin(d*x^2 + c))*sin(d*x^2 + c) - 3*(2*I*a*b*d*x^2 + I*b^2)*d 
ilog(cos(d*x^2 + c) + I*sin(d*x^2 + c))*sin(d*x^2 + c) - 3*(-2*I*a*b*d*x^2 
 - I*b^2)*dilog(cos(d*x^2 + c) - I*sin(d*x^2 + c))*sin(d*x^2 + c) - 3*(2*I 
*a*b*d*x^2 - I*b^2)*dilog(-cos(d*x^2 + c) + I*sin(d*x^2 + c))*sin(d*x^2 + 
c) - 3*(-2*I*a*b*d*x^2 + I*b^2)*dilog(-cos(d*x^2 + c) - I*sin(d*x^2 + c))* 
sin(d*x^2 + c) - 3*(a*b*d^2*x^4 - b^2*d*x^2)*log(cos(d*x^2 + c) + I*sin(d* 
x^2 + c) + 1)*sin(d*x^2 + c) - 3*(a*b*d^2*x^4 - b^2*d*x^2)*log(cos(d*x^2 + 
 c) - I*sin(d*x^2 + c) + 1)*sin(d*x^2 + c) + 3*(a*b*c^2 - b^2*c)*log(-1/2* 
cos(d*x^2 + c) + 1/2*I*sin(d*x^2 + c) + 1/2)*sin(d*x^2 + c) + 3*(a*b*c^2 - 
 b^2*c)*log(-1/2*cos(d*x^2 + c) - 1/2*I*sin(d*x^2 + c) + 1/2)*sin(d*x^2 + 
c) + 3*(a*b*d^2*x^4 + b^2*d*x^2 - a*b*c^2 + b^2*c)*log(-cos(d*x^2 + c) + I 
*sin(d*x^2 + c) + 1)*sin(d*x^2 + c) + 3*(a*b*d^2*x^4 + b^2*d*x^2 - a*b*c^2 
 + b^2*c)*log(-cos(d*x^2 + c) - I*sin(d*x^2 + c) + 1)*sin(d*x^2 + c))/(d^3 
*sin(d*x^2 + c))
 

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 800 vs. \(2 (195) = 390\).

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

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

Output:

1/6*a^2*x^6 - (2*b^2*d^2*x^4*cos(2*d*x^2 + 2*c) + 2*I*b^2*d^2*x^4*sin(2*d* 
x^2 + 2*c) - 2*(a*b*d^2*x^4 - b^2*d*x^2 - (a*b*d^2*x^4 - b^2*d*x^2)*cos(2* 
d*x^2 + 2*c) + (-I*a*b*d^2*x^4 + I*b^2*d*x^2)*sin(2*d*x^2 + 2*c))*arctan2( 
sin(d*x^2 + c), cos(d*x^2 + c) + 1) - 2*(a*b*d^2*x^4 + b^2*d*x^2 - (a*b*d^ 
2*x^4 + b^2*d*x^2)*cos(2*d*x^2 + 2*c) + (-I*a*b*d^2*x^4 - I*b^2*d*x^2)*sin 
(2*d*x^2 + 2*c))*arctan2(sin(d*x^2 + c), -cos(d*x^2 + c) + 1) + 2*(2*a*b*d 
*x^2 - b^2 - (2*a*b*d*x^2 - b^2)*cos(2*d*x^2 + 2*c) - (2*I*a*b*d*x^2 - I*b 
^2)*sin(2*d*x^2 + 2*c))*dilog(-e^(I*d*x^2 + I*c)) - 2*(2*a*b*d*x^2 + b^2 - 
 (2*a*b*d*x^2 + b^2)*cos(2*d*x^2 + 2*c) + (-2*I*a*b*d*x^2 - I*b^2)*sin(2*d 
*x^2 + 2*c))*dilog(e^(I*d*x^2 + I*c)) + (I*a*b*d^2*x^4 - I*b^2*d*x^2 + (-I 
*a*b*d^2*x^4 + I*b^2*d*x^2)*cos(2*d*x^2 + 2*c) + (a*b*d^2*x^4 - b^2*d*x^2) 
*sin(2*d*x^2 + 2*c))*log(cos(d*x^2 + c)^2 + sin(d*x^2 + c)^2 + 2*cos(d*x^2 
 + c) + 1) + (-I*a*b*d^2*x^4 - I*b^2*d*x^2 + (I*a*b*d^2*x^4 + I*b^2*d*x^2) 
*cos(2*d*x^2 + 2*c) - (a*b*d^2*x^4 + b^2*d*x^2)*sin(2*d*x^2 + 2*c))*log(co 
s(d*x^2 + c)^2 + sin(d*x^2 + c)^2 - 2*cos(d*x^2 + c) + 1) - 4*(I*a*b*cos(2 
*d*x^2 + 2*c) - a*b*sin(2*d*x^2 + 2*c) - I*a*b)*polylog(3, -e^(I*d*x^2 + I 
*c)) - 4*(-I*a*b*cos(2*d*x^2 + 2*c) + a*b*sin(2*d*x^2 + 2*c) + I*a*b)*poly 
log(3, e^(I*d*x^2 + I*c)))/(-2*I*d^3*cos(2*d*x^2 + 2*c) + 2*d^3*sin(2*d*x^ 
2 + 2*c) + 2*I*d^3)
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(12*int(csc(c + d*x**2)*x**5,x)*a*b + 6*int(csc(c + d*x**2)**2*x**5,x)*b** 
2 + a**2*x**6)/6