\(\int x (a+b \csc (c+d \sqrt {x}))^2 \, dx\) [38]

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

Optimal result

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

-2*I*b^2*x^(3/2)/d+1/2*a^2*x^2-8*a*b*x^(3/2)*arctanh(exp(I*(c+d*x^(1/2)))) 
/d-2*b^2*x^(3/2)*cot(c+d*x^(1/2))/d+6*b^2*x*ln(1-exp(2*I*(c+d*x^(1/2))))/d 
^2+12*I*a*b*x*polylog(2,-exp(I*(c+d*x^(1/2))))/d^2-12*I*a*b*x*polylog(2,ex 
p(I*(c+d*x^(1/2))))/d^2-6*I*b^2*x^(1/2)*polylog(2,exp(2*I*(c+d*x^(1/2))))/ 
d^3-24*a*b*x^(1/2)*polylog(3,-exp(I*(c+d*x^(1/2))))/d^3+24*a*b*x^(1/2)*pol 
ylog(3,exp(I*(c+d*x^(1/2))))/d^3+3*b^2*polylog(3,exp(2*I*(c+d*x^(1/2))))/d 
^4-24*I*a*b*polylog(4,-exp(I*(c+d*x^(1/2))))/d^4+24*I*a*b*polylog(4,exp(I* 
(c+d*x^(1/2))))/d^4
 

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.66 (sec) , antiderivative size = 337, normalized size of antiderivative = 1.01, 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 \left (a+b \csc \left (c+d \sqrt {x}\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4693

\(\displaystyle 2 \int x^{3/2} \left (a+b \csc \left (c+d \sqrt {x}\right )\right )^2d\sqrt {x}\)

\(\Big \downarrow \) 3042

\(\displaystyle 2 \int x^{3/2} \left (a+b \csc \left (c+d \sqrt {x}\right )\right )^2d\sqrt {x}\)

\(\Big \downarrow \) 4678

\(\displaystyle 2 \int \left (x^{3/2} a^2+2 b x^{3/2} \csc \left (c+d \sqrt {x}\right ) a+b^2 x^{3/2} \csc ^2\left (c+d \sqrt {x}\right )\right )d\sqrt {x}\)

\(\Big \downarrow \) 2009

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

Input:

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

Output:

2*(((-I)*b^2*x^(3/2))/d + (a^2*x^2)/4 - (4*a*b*x^(3/2)*ArcTanh[E^(I*(c + d 
*Sqrt[x]))])/d - (b^2*x^(3/2)*Cot[c + d*Sqrt[x]])/d + (3*b^2*x*Log[1 - E^( 
(2*I)*(c + d*Sqrt[x]))])/d^2 + ((6*I)*a*b*x*PolyLog[2, -E^(I*(c + d*Sqrt[x 
]))])/d^2 - ((6*I)*a*b*x*PolyLog[2, E^(I*(c + d*Sqrt[x]))])/d^2 - ((3*I)*b 
^2*Sqrt[x]*PolyLog[2, E^((2*I)*(c + d*Sqrt[x]))])/d^3 - (12*a*b*Sqrt[x]*Po 
lyLog[3, -E^(I*(c + d*Sqrt[x]))])/d^3 + (12*a*b*Sqrt[x]*PolyLog[3, E^(I*(c 
 + d*Sqrt[x]))])/d^3 + (3*b^2*PolyLog[3, E^((2*I)*(c + d*Sqrt[x]))])/(2*d^ 
4) - ((12*I)*a*b*PolyLog[4, -E^(I*(c + d*Sqrt[x]))])/d^4 + ((12*I)*a*b*Pol 
yLog[4, E^(I*(c + d*Sqrt[x]))])/d^4)
 

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 \left (a +b \csc \left (c +d \sqrt {x}\right )\right )^{2}d x\]

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral(b^2*x*csc(d*sqrt(x) + c)^2 + 2*a*b*x*csc(d*sqrt(x) + c) + a^2*x, 
x)
 

Sympy [F]

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

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

Output:

Integral(x*(a + b*csc(c + d*sqrt(x)))**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. 1950 vs. \(2 (262) = 524\).

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

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

Output:

1/2*((d*sqrt(x) + c)^4*a^2 - 4*(d*sqrt(x) + c)^3*a^2*c + 6*(d*sqrt(x) + c) 
^2*a^2*c^2 - 4*(d*sqrt(x) + c)*a^2*c^3 + 8*a*b*c^3*log(cot(d*sqrt(x) + c) 
+ csc(d*sqrt(x) + c)) + 4*(4*b^2*c^3 + 2*(2*(d*sqrt(x) + c)^3*a*b - 3*b^2* 
c^2 - 3*(2*a*b*c + b^2)*(d*sqrt(x) + c)^2 + 6*(a*b*c^2 + b^2*c)*(d*sqrt(x) 
 + c) - (2*(d*sqrt(x) + c)^3*a*b - 3*b^2*c^2 - 3*(2*a*b*c + b^2)*(d*sqrt(x 
) + c)^2 + 6*(a*b*c^2 + b^2*c)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) + ( 
-2*I*(d*sqrt(x) + c)^3*a*b + 3*I*b^2*c^2 + 3*(2*I*a*b*c + I*b^2)*(d*sqrt(x 
) + c)^2 + 6*(-I*a*b*c^2 - I*b^2*c)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c 
))*arctan2(sin(d*sqrt(x) + c), cos(d*sqrt(x) + c) + 1) + 6*(b^2*c^2*cos(2* 
d*sqrt(x) + 2*c) + I*b^2*c^2*sin(2*d*sqrt(x) + 2*c) - b^2*c^2)*arctan2(sin 
(d*sqrt(x) + c), cos(d*sqrt(x) + c) - 1) + 2*(2*(d*sqrt(x) + c)^3*a*b - 3* 
(2*a*b*c - b^2)*(d*sqrt(x) + c)^2 + 6*(a*b*c^2 - b^2*c)*(d*sqrt(x) + c) - 
(2*(d*sqrt(x) + c)^3*a*b - 3*(2*a*b*c - b^2)*(d*sqrt(x) + c)^2 + 6*(a*b*c^ 
2 - b^2*c)*(d*sqrt(x) + c))*cos(2*d*sqrt(x) + 2*c) + (-2*I*(d*sqrt(x) + c) 
^3*a*b + 3*(2*I*a*b*c - I*b^2)*(d*sqrt(x) + c)^2 + 6*(-I*a*b*c^2 + I*b^2*c 
)*(d*sqrt(x) + c))*sin(2*d*sqrt(x) + 2*c))*arctan2(sin(d*sqrt(x) + c), -co 
s(d*sqrt(x) + c) + 1) - 4*((d*sqrt(x) + c)^3*b^2 - 3*(d*sqrt(x) + c)^2*b^2 
*c + 3*(d*sqrt(x) + c)*b^2*c^2)*cos(2*d*sqrt(x) + 2*c) - 12*((d*sqrt(x) + 
c)^2*a*b + a*b*c^2 + b^2*c - (2*a*b*c + b^2)*(d*sqrt(x) + c) - ((d*sqrt(x) 
 + c)^2*a*b + a*b*c^2 + b^2*c - (2*a*b*c + b^2)*(d*sqrt(x) + c))*cos(2*...
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

(4*int(csc(sqrt(x)*d + c)*x,x)*a*b + 2*int(csc(sqrt(x)*d + c)**2*x,x)*b**2 
 + a**2*x**2)/2