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

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

Optimal result

Integrand size = 22, antiderivative size = 141 \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {a (e x)^{2 n}}{2 e n}-\frac {2 b x^{-n} (e x)^{2 n} \text {arctanh}\left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac {i b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {i b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )}{d^2 e n} \] Output:

1/2*a*(e*x)^(2*n)/e/n-2*b*(e*x)^(2*n)*arctanh(exp(I*(c+d*x^n)))/d/e/n/(x^n 
)+I*b*(e*x)^(2*n)*polylog(2,-exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))-I*b*(e*x) 
^(2*n)*polylog(2,exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))
 

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.31 \[ \int (e x)^{-1+2 n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {x^{-2 n} (e x)^{2 n} \left (a d^2 x^{2 n}+2 b c \log \left (1-e^{i \left (c+d x^n\right )}\right )+2 b d x^n \log \left (1-e^{i \left (c+d x^n\right )}\right )-2 b c \log \left (1+e^{i \left (c+d x^n\right )}\right )-2 b d x^n \log \left (1+e^{i \left (c+d x^n\right )}\right )-2 b c \log \left (\tan \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )+2 i b \operatorname {PolyLog}\left (2,-e^{i \left (c+d x^n\right )}\right )-2 i b \operatorname {PolyLog}\left (2,e^{i \left (c+d x^n\right )}\right )\right )}{2 d^2 e n} \] Input:

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

Output:

((e*x)^(2*n)*(a*d^2*x^(2*n) + 2*b*c*Log[1 - E^(I*(c + d*x^n))] + 2*b*d*x^n 
*Log[1 - E^(I*(c + d*x^n))] - 2*b*c*Log[1 + E^(I*(c + d*x^n))] - 2*b*d*x^n 
*Log[1 + E^(I*(c + d*x^n))] - 2*b*c*Log[Tan[(c + d*x^n)/2]] + (2*I)*b*Poly 
Log[2, -E^(I*(c + d*x^n))] - (2*I)*b*PolyLog[2, E^(I*(c + d*x^n))]))/(2*d^ 
2*e*n*x^(2*n))
 

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {2010, 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)^{2 n-1} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx\)

\(\Big \downarrow \) 2010

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

(a*(e*x)^(2*n))/(2*e*n) - (2*b*(e*x)^(2*n)*ArcTanh[E^(I*(c + d*x^n))])/(d* 
e*n*x^n) + (I*b*(e*x)^(2*n)*PolyLog[2, -E^(I*(c + d*x^n))])/(d^2*e*n*x^(2* 
n)) - (I*b*(e*x)^(2*n)*PolyLog[2, E^(I*(c + d*x^n))])/(d^2*e*n*x^(2*n))
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 2010
Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x] 
, x] /; FreeQ[{c, m}, x] && SumQ[u] &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) 
+ (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]
 
Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 0.37 (sec) , antiderivative size = 731, normalized size of antiderivative = 5.18

method result size
risch \(\text {Expression too large to display}\) \(731\)

Input:

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

Output:

1/2*a/n*x*exp(1/2*(-1+2*n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi+I*csgn(I 
*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*e*x)^2*Pi-I*csgn(I*e*x)^3*Pi+2*ln( 
x)+2*ln(e)))+1/d/n/e*(e^n)^2*b*ln(1-exp(I*(c+d*x^n)))*x^n*(-1)^(-1/2*csgn( 
I*x)*csgn(I*e*x)^2)*(-1)^(-1/2*csgn(I*e)*csgn(I*e*x)^2)*(-1)^(1/2*csgn(I*e 
)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e)*csgn(I*x)* 
n+2*csgn(I*e)*csgn(I*e*x)*n+2*n*csgn(I*x)*csgn(I*e*x)-2*n*csgn(I*e*x)^2+cs 
gn(I*e*x)^2))-1/d/n/e*(e^n)^2*b*ln(exp(I*(c+d*x^n))+1)*x^n*(-1)^(-1/2*csgn 
(I*x)*csgn(I*e*x)^2)*(-1)^(-1/2*csgn(I*e)*csgn(I*e*x)^2)*(-1)^(1/2*csgn(I* 
e)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e)*csgn(I*x) 
*n+2*csgn(I*e)*csgn(I*e*x)*n+2*n*csgn(I*x)*csgn(I*e*x)-2*n*csgn(I*e*x)^2+c 
sgn(I*e*x)^2))-I/d^2/n/e*(e^n)^2*b*dilog(1-exp(I*(c+d*x^n)))*(-1)^(-1/2*cs 
gn(I*x)*csgn(I*e*x)^2)*(-1)^(-1/2*csgn(I*e)*csgn(I*e*x)^2)*(-1)^(1/2*csgn( 
I*e)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e)*csgn(I* 
x)*n+2*csgn(I*e)*csgn(I*e*x)*n+2*n*csgn(I*x)*csgn(I*e*x)-2*n*csgn(I*e*x)^2 
+csgn(I*e*x)^2))+I/d^2/n/e*(e^n)^2*b*dilog(exp(I*(c+d*x^n))+1)*(-1)^(-1/2* 
csgn(I*x)*csgn(I*e*x)^2)*(-1)^(-1/2*csgn(I*e)*csgn(I*e*x)^2)*(-1)^(1/2*csg 
n(I*e)*csgn(I*x)*csgn(I*e*x))*exp(1/2*I*Pi*csgn(I*e*x)*(-2*csgn(I*e)*csgn( 
I*x)*n+2*csgn(I*e)*csgn(I*e*x)*n+2*n*csgn(I*x)*csgn(I*e*x)-2*n*csgn(I*e*x) 
^2+csgn(I*e*x)^2))
 

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. 384 vs. \(2 (131) = 262\).

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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