\(\int (e x)^{-1+3 n} (a+b \csc (c+d x^n))^2 \, dx\) [78]

Optimal result
Mathematica [F]
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 = 24, antiderivative size = 377 \[ \int (e x)^{-1+3 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx=\frac {a^2 (e x)^{3 n}}{3 e n}-\frac {i b^2 x^{-n} (e x)^{3 n}}{d e n}-\frac {4 a b x^{-n} (e x)^{3 n} \text {arctanh}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}-\frac {b^2 x^{-n} (e x)^{3 n} \cot \left (c+d x^n\right )}{d e n}+\frac {2 b^2 x^{-2 n} (e x)^{3 n} \log \left (1-e^{2 i \left (c+d x^n\right )}\right )}{d^2 e n}+\frac {4 i a b x^{-2 n} (e x)^{3 n} \operatorname {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {4 i a b x^{-2 n} (e x)^{3 n} \operatorname {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {i b^2 x^{-3 n} (e x)^{3 n} \operatorname {PolyLog}\left (2,e^{2 i \left (c+d x^n\right )}\right )}{d^3 e n}-\frac {4 a b x^{-3 n} (e x)^{3 n} \operatorname {PolyLog}\left (3,-e^{i \left (c+d x^n\right )}\right )}{d^3 e n}+\frac {4 a b x^{-3 n} (e x)^{3 n} \operatorname {PolyLog}\left (3,e^{i \left (c+d x^n\right )}\right )}{d^3 e n} \] Output:

1/3*a^2*(e*x)^(3*n)/e/n-I*b^2*(e*x)^(3*n)/d/e/n/(x^n)-4*a*b*(e*x)^(3*n)*ar 
ctanh(exp(I*(c+d*x^n)))/d/e/n/(x^n)-b^2*(e*x)^(3*n)*cot(c+d*x^n)/d/e/n/(x^ 
n)+2*b^2*(e*x)^(3*n)*ln(1-exp(2*I*(c+d*x^n)))/d^2/e/n/(x^(2*n))+4*I*a*b*(e 
*x)^(3*n)*polylog(2,-exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))-4*I*a*b*(e*x)^(3* 
n)*polylog(2,exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))-I*b^2*(e*x)^(3*n)*polylog 
(2,exp(2*I*(c+d*x^n)))/d^3/e/n/(x^(3*n))-4*a*b*(e*x)^(3*n)*polylog(3,-exp( 
I*(c+d*x^n)))/d^3/e/n/(x^(3*n))+4*a*b*(e*x)^(3*n)*polylog(3,exp(I*(c+d*x^n 
)))/d^3/e/n/(x^(3*n))
 

Mathematica [F]

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

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

Output:

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

Rubi [A] (verified)

Time = 0.65 (sec) , antiderivative size = 250, normalized size of antiderivative = 0.66, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {4697, 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 (e x)^{3 n-1} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx\)

\(\Big \downarrow \) 4697

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

\(\Big \downarrow \) 4693

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4678

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

((e*x)^(3*n)*(((-I)*b^2*x^(2*n))/d + (a^2*x^(3*n))/3 - (4*a*b*x^(2*n)*ArcT 
anh[E^(I*(c + d*x^n))])/d - (b^2*x^(2*n)*Cot[c + d*x^n])/d + (2*b^2*x^n*Lo 
g[1 - E^((2*I)*(c + d*x^n))])/d^2 + ((4*I)*a*b*x^n*PolyLog[2, -E^(I*(c + d 
*x^n))])/d^2 - ((4*I)*a*b*x^n*PolyLog[2, E^(I*(c + d*x^n))])/d^2 - (I*b^2* 
PolyLog[2, E^((2*I)*(c + d*x^n))])/d^3 - (4*a*b*PolyLog[3, -E^(I*(c + d*x^ 
n))])/d^3 + (4*a*b*PolyLog[3, E^(I*(c + d*x^n))])/d^3))/(e*n*x^(3*n))
 

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]
 

rule 4697
Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*((e_)*(x_))^(m_.), x 
_Symbol] :> Simp[e^IntPart[m]*((e*x)^FracPart[m]/x^FracPart[m])   Int[x^m*( 
a + b*Csc[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]
 
Maple [F]

\[\int \left (e x \right )^{-1+3 n} {\left (a +b \csc \left (c +d \,x^{n}\right )\right )}^{2}d x\]

Input:

int((e*x)^(-1+3*n)*(a+b*csc(c+d*x^n))^2,x)
 

Output:

int((e*x)^(-1+3*n)*(a+b*csc(c+d*x^n))^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. 890 vs. \(2 (362) = 724\).

Time = 0.13 (sec) , antiderivative size = 890, normalized size of antiderivative = 2.36 \[ \int (e x)^{-1+3 n} \left (a+b \csc \left (c+d x^n\right )\right )^2 \, dx =\text {Too large to display} \] Input:

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

Output:

1/3*(a^2*d^3*e^(3*n - 1)*x^(3*n)*sin(d*x^n + c) - 3*b^2*d^2*e^(3*n - 1)*x^ 
(2*n)*cos(d*x^n + c) + 6*a*b*e^(3*n - 1)*polylog(3, cos(d*x^n + c) + I*sin 
(d*x^n + c))*sin(d*x^n + c) + 6*a*b*e^(3*n - 1)*polylog(3, cos(d*x^n + c) 
- I*sin(d*x^n + c))*sin(d*x^n + c) - 6*a*b*e^(3*n - 1)*polylog(3, -cos(d*x 
^n + c) + I*sin(d*x^n + c))*sin(d*x^n + c) - 6*a*b*e^(3*n - 1)*polylog(3, 
-cos(d*x^n + c) - I*sin(d*x^n + c))*sin(d*x^n + c) + 3*(a*b*c^2 - b^2*c)*e 
^(3*n - 1)*log(-1/2*cos(d*x^n + c) + 1/2*I*sin(d*x^n + c) + 1/2)*sin(d*x^n 
 + c) + 3*(a*b*c^2 - b^2*c)*e^(3*n - 1)*log(-1/2*cos(d*x^n + c) - 1/2*I*si 
n(d*x^n + c) + 1/2)*sin(d*x^n + c) - 3*(2*I*a*b*d*e^(3*n - 1)*x^n + I*b^2* 
e^(3*n - 1))*dilog(cos(d*x^n + c) + I*sin(d*x^n + c))*sin(d*x^n + c) - 3*( 
-2*I*a*b*d*e^(3*n - 1)*x^n - I*b^2*e^(3*n - 1))*dilog(cos(d*x^n + c) - I*s 
in(d*x^n + c))*sin(d*x^n + c) - 3*(2*I*a*b*d*e^(3*n - 1)*x^n - I*b^2*e^(3* 
n - 1))*dilog(-cos(d*x^n + c) + I*sin(d*x^n + c))*sin(d*x^n + c) - 3*(-2*I 
*a*b*d*e^(3*n - 1)*x^n + I*b^2*e^(3*n - 1))*dilog(-cos(d*x^n + c) - I*sin( 
d*x^n + c))*sin(d*x^n + c) - 3*(a*b*d^2*e^(3*n - 1)*x^(2*n) - b^2*d*e^(3*n 
 - 1)*x^n)*log(cos(d*x^n + c) + I*sin(d*x^n + c) + 1)*sin(d*x^n + c) - 3*( 
a*b*d^2*e^(3*n - 1)*x^(2*n) - b^2*d*e^(3*n - 1)*x^n)*log(cos(d*x^n + c) - 
I*sin(d*x^n + c) + 1)*sin(d*x^n + c) + 3*(a*b*d^2*e^(3*n - 1)*x^(2*n) + b^ 
2*d*e^(3*n - 1)*x^n - (a*b*c^2 - b^2*c)*e^(3*n - 1))*log(-cos(d*x^n + c) + 
 I*sin(d*x^n + c) + 1)*sin(d*x^n + c) + 3*(a*b*d^2*e^(3*n - 1)*x^(2*n) ...
 

Sympy [F]

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

integrate((e*x)**(-1+3*n)*(a+b*csc(c+d*x**n))**2,x)
 

Output:

Integral((e*x)**(3*n - 1)*(a + b*csc(c + d*x**n))**2, x)
 

Maxima [F]

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

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

Output:

1/3*(e*x)^(3*n)*a^2/(e*n) - (2*b^2*e^(3*n)*x^(2*n)*sin(2*d*x^n + 2*c) - (d 
*e*n*cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x 
^n + 2*c) + d*e*n)*integrate(2*(a*b*d*e^(3*n)*x^(3*n) - b^2*e^(3*n)*x^(2*n 
))*sin(d*x^n + c)/(d*e*x*cos(d*x^n + c)^2 + d*e*x*sin(d*x^n + c)^2 + 2*d*e 
*x*cos(d*x^n + c) + d*e*x), x) - (d*e*n*cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2 
*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x^n + 2*c) + d*e*n)*integrate(2*(a*b*d*e 
^(3*n)*x^(3*n) + b^2*e^(3*n)*x^(2*n))*sin(d*x^n + c)/(d*e*x*cos(d*x^n + c) 
^2 + d*e*x*sin(d*x^n + c)^2 - 2*d*e*x*cos(d*x^n + c) + d*e*x), x))/(d*e*n* 
cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 - 2*d*e*n*cos(2*d*x^n + 
2*c) + d*e*n)
 

Giac [F]

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

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

Output:

integrate((b*csc(d*x^n + c) + a)^2*(e*x)^(3*n - 1), x)
 

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

int((e*x)^(-1+3*n)*(a+b*csc(c+d*x^n))^2,x)
 

Output:

(e**(3*n)*(x**(3*n)*a**2 + 6*int((x**(3*n)*csc(x**n*d + c))/x,x)*a*b*n + 3 
*int((x**(3*n)*csc(x**n*d + c)**2)/x,x)*b**2*n))/(3*e*n)