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

Optimal result
Mathematica [B] (warning: unable to verify)
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 = 125 \[ \int x^3 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx=\frac {a^2 x^4}{4}-\frac {2 a b x^2 \text {arctanh}\left (e^{i \left (c+d x^2\right )}\right )}{d}-\frac {b^2 x^2 \cot \left (c+d x^2\right )}{2 d}+\frac {b^2 \log \left (\sin \left (c+d x^2\right )\right )}{2 d^2}+\frac {i a b \operatorname {PolyLog}\left (2,-e^{i \left (c+d x^2\right )}\right )}{d^2}-\frac {i a b \operatorname {PolyLog}\left (2,e^{i \left (c+d x^2\right )}\right )}{d^2} \] Output:

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

Mathematica [B] (warning: unable to verify)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(268\) vs. \(2(125)=250\).

Time = 3.96 (sec) , antiderivative size = 268, normalized size of antiderivative = 2.14 \[ \int x^3 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx=\frac {2 b^2 d x^2 \cot (c)+d x^2 \left (a^2 d x^2-2 b^2 \cot (c)\right )-2 b^2 \left (d x^2 \cot (c)-\log \left (\sin \left (c+d x^2\right )\right )\right )+4 a b \left (2 \arctan (\tan (c)) \text {arctanh}\left (\cos (c)-\sin (c) \tan \left (\frac {d x^2}{2}\right )\right )+\frac {\left (\left (d x^2+\arctan (\tan (c))\right ) \left (\log \left (1-e^{i \left (d x^2+\arctan (\tan (c))\right )}\right )-\log \left (1+e^{i \left (d x^2+\arctan (\tan (c))\right )}\right )\right )+i \operatorname {PolyLog}\left (2,-e^{i \left (d x^2+\arctan (\tan (c))\right )}\right )-i \operatorname {PolyLog}\left (2,e^{i \left (d x^2+\arctan (\tan (c))\right )}\right )\right ) \sec (c)}{\sqrt {\sec ^2(c)}}\right )+b^2 d x^2 \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 )+b^2 d x^2 \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 )}{4 d^2} \] Input:

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

Output:

(2*b^2*d*x^2*Cot[c] + d*x^2*(a^2*d*x^2 - 2*b^2*Cot[c]) - 2*b^2*(d*x^2*Cot[ 
c] - Log[Sin[c + d*x^2]]) + 4*a*b*(2*ArcTan[Tan[c]]*ArcTanh[Cos[c] - Sin[c 
]*Tan[(d*x^2)/2]] + (((d*x^2 + ArcTan[Tan[c]])*(Log[1 - E^(I*(d*x^2 + ArcT 
an[Tan[c]]))] - Log[1 + E^(I*(d*x^2 + ArcTan[Tan[c]]))]) + I*PolyLog[2, -E 
^(I*(d*x^2 + ArcTan[Tan[c]]))] - I*PolyLog[2, E^(I*(d*x^2 + ArcTan[Tan[c]] 
))])*Sec[c])/Sqrt[Sec[c]^2]) + b^2*d*x^2*Csc[c/2]*Csc[(c + d*x^2)/2]*Sin[( 
d*x^2)/2] + b^2*d*x^2*Sec[c/2]*Sec[(c + d*x^2)/2]*Sin[(d*x^2)/2])/(4*d^2)
 

Rubi [A] (verified)

Time = 0.37 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.99, 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^3 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4693

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

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int x^2 \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^2+b^2 \csc ^2\left (d x^2+c\right ) x^2+2 a b \csc \left (d x^2+c\right ) x^2\right )dx^2\)

\(\Big \downarrow \) 2009

\(\displaystyle \frac {1}{2} \left (\frac {a^2 x^4}{2}-\frac {4 a b x^2 \text {arctanh}\left (e^{i \left (c+d x^2\right )}\right )}{d}+\frac {2 i a b \operatorname {PolyLog}\left (2,-e^{i \left (d x^2+c\right )}\right )}{d^2}-\frac {2 i a b \operatorname {PolyLog}\left (2,e^{i \left (d x^2+c\right )}\right )}{d^2}+\frac {b^2 \log \left (\sin \left (c+d x^2\right )\right )}{d^2}-\frac {b^2 x^2 \cot \left (c+d x^2\right )}{d}\right )\)

Input:

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

Output:

((a^2*x^4)/2 - (4*a*b*x^2*ArcTanh[E^(I*(c + d*x^2))])/d - (b^2*x^2*Cot[c + 
 d*x^2])/d + (b^2*Log[Sin[c + d*x^2]])/d^2 + ((2*I)*a*b*PolyLog[2, -E^(I*( 
c + d*x^2))])/d^2 - ((2*I)*a*b*PolyLog[2, E^(I*(c + d*x^2))])/d^2)/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^{3} {\left (a +b \csc \left (d \,x^{2}+c \right )\right )}^{2}d x\]

Input:

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

Output:

int(x^3*(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. 451 vs. \(2 (107) = 214\).

Time = 0.10 (sec) , antiderivative size = 451, normalized size of antiderivative = 3.61 \[ \int x^3 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx=\frac {a^{2} d^{2} x^{4} \sin \left (d x^{2} + c\right ) - 2 \, b^{2} d x^{2} \cos \left (d x^{2} + c\right ) - 2 i \, a b {\rm Li}_2\left (\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right )\right ) \sin \left (d x^{2} + c\right ) + 2 i \, a b {\rm Li}_2\left (\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right )\right ) \sin \left (d x^{2} + c\right ) - 2 i \, a b {\rm Li}_2\left (-\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right )\right ) \sin \left (d x^{2} + c\right ) + 2 i \, a b {\rm Li}_2\left (-\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right )\right ) \sin \left (d x^{2} + c\right ) - {\left (2 \, a b d x^{2} - b^{2}\right )} \log \left (\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + 1\right ) \sin \left (d x^{2} + c\right ) - {\left (2 \, a b d x^{2} - b^{2}\right )} \log \left (\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + 1\right ) \sin \left (d x^{2} + c\right ) - {\left (2 \, a b c - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x^{2} + c\right ) + \frac {1}{2} i \, \sin \left (d x^{2} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{2} + c\right ) - {\left (2 \, a b c - b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x^{2} + c\right ) - \frac {1}{2} i \, \sin \left (d x^{2} + c\right ) + \frac {1}{2}\right ) \sin \left (d x^{2} + c\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \log \left (-\cos \left (d x^{2} + c\right ) + i \, \sin \left (d x^{2} + c\right ) + 1\right ) \sin \left (d x^{2} + c\right ) + 2 \, {\left (a b d x^{2} + a b c\right )} \log \left (-\cos \left (d x^{2} + c\right ) - i \, \sin \left (d x^{2} + c\right ) + 1\right ) \sin \left (d x^{2} + c\right )}{4 \, d^{2} \sin \left (d x^{2} + c\right )} \] Input:

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

Output:

1/4*(a^2*d^2*x^4*sin(d*x^2 + c) - 2*b^2*d*x^2*cos(d*x^2 + c) - 2*I*a*b*dil 
og(cos(d*x^2 + c) + I*sin(d*x^2 + c))*sin(d*x^2 + c) + 2*I*a*b*dilog(cos(d 
*x^2 + c) - I*sin(d*x^2 + c))*sin(d*x^2 + c) - 2*I*a*b*dilog(-cos(d*x^2 + 
c) + I*sin(d*x^2 + c))*sin(d*x^2 + c) + 2*I*a*b*dilog(-cos(d*x^2 + c) - I* 
sin(d*x^2 + c))*sin(d*x^2 + c) - (2*a*b*d*x^2 - b^2)*log(cos(d*x^2 + c) + 
I*sin(d*x^2 + c) + 1)*sin(d*x^2 + c) - (2*a*b*d*x^2 - b^2)*log(cos(d*x^2 + 
 c) - I*sin(d*x^2 + c) + 1)*sin(d*x^2 + c) - (2*a*b*c - b^2)*log(-1/2*cos( 
d*x^2 + c) + 1/2*I*sin(d*x^2 + c) + 1/2)*sin(d*x^2 + c) - (2*a*b*c - b^2)* 
log(-1/2*cos(d*x^2 + c) - 1/2*I*sin(d*x^2 + c) + 1/2)*sin(d*x^2 + c) + 2*( 
a*b*d*x^2 + a*b*c)*log(-cos(d*x^2 + c) + I*sin(d*x^2 + c) + 1)*sin(d*x^2 + 
 c) + 2*(a*b*d*x^2 + a*b*c)*log(-cos(d*x^2 + c) - I*sin(d*x^2 + c) + 1)*si 
n(d*x^2 + c))/(d^2*sin(d*x^2 + c))
 

Sympy [F]

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

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

Output:

Integral(x**3*(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. 604 vs. \(2 (107) = 214\).

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

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

Output:

1/4*a^2*x^4 - (4*b^2*d*x^2*cos(2*d*x^2 + 2*c) + 4*I*b^2*d*x^2*sin(2*d*x^2 
+ 2*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))*arctan2(sin(d*x^2 + c), cos(d* 
x^2 + c) + 1) - 2*(b^2*cos(2*d*x^2 + 2*c) + I*b^2*sin(2*d*x^2 + 2*c) - b^2 
)*arctan2(sin(d*x^2 + c), cos(d*x^2 + c) - 1) + 4*(a*b*d*x^2*cos(2*d*x^2 + 
 2*c) + I*a*b*d*x^2*sin(2*d*x^2 + 2*c) - a*b*d*x^2)*arctan2(sin(d*x^2 + c) 
, -cos(d*x^2 + c) + 1) - 4*(a*b*cos(2*d*x^2 + 2*c) + I*a*b*sin(2*d*x^2 + 2 
*c) - a*b)*dilog(-e^(I*d*x^2 + I*c)) + 4*(a*b*cos(2*d*x^2 + 2*c) + I*a*b*s 
in(2*d*x^2 + 2*c) - a*b)*dilog(e^(I*d*x^2 + I*c)) + (2*I*a*b*d*x^2 - I*b^2 
 + (-2*I*a*b*d*x^2 + I*b^2)*cos(2*d*x^2 + 2*c) + (2*a*b*d*x^2 - b^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) + (-2*I*a*b*d*x^2 - I*b^2 + (2*I*a*b*d*x^2 + I*b^2)*cos(2*d*x^2 + 2*c 
) - (2*a*b*d*x^2 + b^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))/(-4*I*d^2*cos(2*d*x^2 + 2*c) + 4*d^2*si 
n(2*d*x^2 + 2*c) + 4*I*d^2)
 

Giac [F]

\[ \int x^3 \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^{3} \,d x } \] Input:

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int x^3 \left (a+b \csc \left (c+d x^2\right )\right )^2 \, dx=\frac {-2 \cos \left (d \,x^{2}+c \right ) b^{2} d \,x^{2}+8 \left (\int \csc \left (d \,x^{2}+c \right ) x^{3}d x \right ) \sin \left (d \,x^{2}+c \right ) a b \,d^{2}-2 \,\mathrm {log}\left (\tan \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )^{2}+1\right ) \sin \left (d \,x^{2}+c \right ) b^{2}+2 \,\mathrm {log}\left (\tan \left (\frac {d \,x^{2}}{2}+\frac {c}{2}\right )\right ) \sin \left (d \,x^{2}+c \right ) b^{2}+\sin \left (d \,x^{2}+c \right ) a^{2} d^{2} x^{4}}{4 \sin \left (d \,x^{2}+c \right ) d^{2}} \] Input:

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

Output:

( - 2*cos(c + d*x**2)*b**2*d*x**2 + 8*int(csc(c + d*x**2)*x**3,x)*sin(c + 
d*x**2)*a*b*d**2 - 2*log(tan((c + d*x**2)/2)**2 + 1)*sin(c + d*x**2)*b**2 
+ 2*log(tan((c + d*x**2)/2))*sin(c + d*x**2)*b**2 + sin(c + d*x**2)*a**2*d 
**2*x**4)/(4*sin(c + d*x**2)*d**2)