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

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

Optimal result

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

(e*x)^n/a/e/n+2*b*(e*x)^n*arctanh((a+b*tan(1/2*c+1/2*d*x^n))/(a^2-b^2)^(1/ 
2))/a/(a^2-b^2)^(1/2)/d/e/n/(x^n)
 

Mathematica [A] (verified)

Time = 0.59 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.93 \[ \int \frac {(e x)^{-1+n}}{a+b \csc \left (c+d x^n\right )} \, dx=\frac {(e x)^n \left (d+c x^{-n}-\frac {2 b x^{-n} \arctan \left (\frac {a+b \tan \left (\frac {1}{2} \left (c+d x^n\right )\right )}{\sqrt {-a^2+b^2}}\right )}{\sqrt {-a^2+b^2}}\right )}{a d e n} \] Input:

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

Output:

((e*x)^n*(d + c/x^n - (2*b*ArcTan[(a + b*Tan[(c + d*x^n)/2])/Sqrt[-a^2 + b 
^2]])/(Sqrt[-a^2 + b^2]*x^n)))/(a*d*e*n)
 

Rubi [A] (verified)

Time = 0.44 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.02, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4697, 4693, 3042, 4270, 3042, 3139, 1083, 219}

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

\(\Big \downarrow \) 4697

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

\(\Big \downarrow \) 4693

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4270

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3139

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

\(\Big \downarrow \) 1083

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

\(\Big \downarrow \) 219

\(\displaystyle \frac {x^{-n} (e x)^n \left (\frac {2 b \text {arctanh}\left (\frac {b \left (\frac {2 a}{b}+2 \tan \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}{2 \sqrt {a^2-b^2}}\right )}{a d \sqrt {a^2-b^2}}+\frac {x^n}{a}\right )}{e n}\)

Input:

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

Output:

((e*x)^n*(x^n/a + (2*b*ArcTanh[(b*((2*a)/b + 2*Tan[(c + d*x^n)/2]))/(2*Sqr 
t[a^2 - b^2])])/(a*Sqrt[a^2 - b^2]*d)))/(e*n*x^n)
 

Defintions of rubi rules used

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3139
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre 
eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d)   Subst[Int[1/(a + 2*b*e*x + a 
*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ 
[a^2 - b^2, 0]
 

rule 4270
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(-1), x_Symbol] :> Simp[x/a, x] 
- Simp[1/a   Int[1/(1 + (a/b)*Sin[c + d*x]), x], x] /; FreeQ[{a, b, c, d}, 
x] && NeQ[a^2 - b^2, 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 [C] (warning: unable to verify)

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

Time = 0.35 (sec) , antiderivative size = 315, normalized size of antiderivative = 3.71

method result size
risch \(\frac {x \,{\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right ) \pi +i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi +i \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi -i \operatorname {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (x \right )+2 \ln \left (e \right )\right )}{2}}}{a n}-\frac {2 i \arctan \left (\frac {2 i a \,{\mathrm e}^{i \left (d \,x^{n}+2 c \right )}-2 \,{\mathrm e}^{i c} b}{2 \sqrt {a^{2} {\mathrm e}^{2 i c}-{\mathrm e}^{2 i c} b^{2}}}\right ) e^{n} b \,{\mathrm e}^{\frac {i \left (-\pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )+\pi n \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2}+\pi n \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2}-\pi n \operatorname {csgn}\left (i e x \right )^{3}+\pi \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )-\pi \,\operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2}-\pi \,\operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2}+\pi \operatorname {csgn}\left (i e x \right )^{3}+2 c \right )}{2}}}{\sqrt {a^{2} {\mathrm e}^{2 i c}-{\mathrm e}^{2 i c} b^{2}}\, d e n a}\) \(315\)

Input:

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

Output:

1/a/n*x*exp(1/2*(-1+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)))-2*I*arctan(1/2*(2*I*a*exp(I*(d*x^n+2*c))-2*exp(I*c)*b)/(a^2*exp(2 
*I*c)-exp(2*I*c)*b^2)^(1/2))/(a^2*exp(2*I*c)-exp(2*I*c)*b^2)^(1/2)/d/e*e^n 
/n/a*b*exp(1/2*I*(-Pi*n*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+Pi*n*csgn(I*e)*csg 
n(I*e*x)^2+Pi*n*csgn(I*x)*csgn(I*e*x)^2-Pi*n*csgn(I*e*x)^3+Pi*csgn(I*e)*cs 
gn(I*x)*csgn(I*e*x)-Pi*csgn(I*e)*csgn(I*e*x)^2-Pi*csgn(I*x)*csgn(I*e*x)^2+ 
Pi*csgn(I*e*x)^3+2*c))
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 301, normalized size of antiderivative = 3.54 \[ \int \frac {(e x)^{-1+n}}{a+b \csc \left (c+d x^n\right )} \, dx=\left [\frac {2 \, {\left (a^{2} - b^{2}\right )} d e^{n - 1} x^{n} + \sqrt {a^{2} - b^{2}} b e^{n - 1} \log \left (\frac {{\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x^{n} + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} a \cos \left (d x^{n} + c\right ) + a^{2} + b^{2} + 2 \, {\left (\sqrt {a^{2} - b^{2}} b \cos \left (d x^{n} + c\right ) + a b\right )} \sin \left (d x^{n} + c\right )}{a^{2} \cos \left (d x^{n} + c\right )^{2} - 2 \, a b \sin \left (d x^{n} + c\right ) - a^{2} - b^{2}}\right )}{2 \, {\left (a^{3} - a b^{2}\right )} d n}, \frac {{\left (a^{2} - b^{2}\right )} d e^{n - 1} x^{n} + \sqrt {-a^{2} + b^{2}} b e^{n - 1} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} b \sin \left (d x^{n} + c\right ) + \sqrt {-a^{2} + b^{2}} a}{{\left (a^{2} - b^{2}\right )} \cos \left (d x^{n} + c\right )}\right )}{{\left (a^{3} - a b^{2}\right )} d n}\right ] \] Input:

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

Output:

[1/2*(2*(a^2 - b^2)*d*e^(n - 1)*x^n + sqrt(a^2 - b^2)*b*e^(n - 1)*log(((a^ 
2 - 2*b^2)*cos(d*x^n + c)^2 + 2*sqrt(a^2 - b^2)*a*cos(d*x^n + c) + a^2 + b 
^2 + 2*(sqrt(a^2 - b^2)*b*cos(d*x^n + c) + a*b)*sin(d*x^n + c))/(a^2*cos(d 
*x^n + c)^2 - 2*a*b*sin(d*x^n + c) - a^2 - b^2)))/((a^3 - a*b^2)*d*n), ((a 
^2 - b^2)*d*e^(n - 1)*x^n + sqrt(-a^2 + b^2)*b*e^(n - 1)*arctan(-(sqrt(-a^ 
2 + b^2)*b*sin(d*x^n + c) + sqrt(-a^2 + b^2)*a)/((a^2 - b^2)*cos(d*x^n + c 
))))/((a^3 - a*b^2)*d*n)]
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 17.10 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.69 \[ \int \frac {(e x)^{-1+n}}{a+b \csc \left (c+d x^n\right )} \, dx=\frac {x\,{\left (e\,x\right )}^{n-1}}{a\,n}-\frac {b\,x\,\ln \left (b\,x\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}-\frac {2\,b\,x\,{\left (e\,x\right )}^{n-1}\,\left (a\,1{}\mathrm {i}+b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\right )}{\sqrt {a+b}\,\sqrt {a-b}}\right )\,{\left (e\,x\right )}^{n-1}}{a\,d\,n\,x^n\,\sqrt {a+b}\,\sqrt {a-b}}+\frac {b\,x\,\ln \left (b\,x\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}+\frac {2\,b\,x\,{\left (e\,x\right )}^{n-1}\,\left (a\,1{}\mathrm {i}+b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\right )}{\sqrt {a+b}\,\sqrt {a-b}}\right )\,{\left (e\,x\right )}^{n-1}}{a\,d\,n\,x^n\,\sqrt {a+b}\,\sqrt {a-b}} \] Input:

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

Output:

(x*(e*x)^(n - 1))/(a*n) - (b*x*log(b*x*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 
1)*2i - (2*b*x*(e*x)^(n - 1)*(a*1i + b*exp(c*1i)*exp(d*x^n*1i)))/((a + b)^ 
(1/2)*(a - b)^(1/2)))*(e*x)^(n - 1))/(a*d*n*x^n*(a + b)^(1/2)*(a - b)^(1/2 
)) + (b*x*log(b*x*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 1)*2i + (2*b*x*(e*x)^ 
(n - 1)*(a*1i + b*exp(c*1i)*exp(d*x^n*1i)))/((a + b)^(1/2)*(a - b)^(1/2))) 
*(e*x)^(n - 1))/(a*d*n*x^n*(a + b)^(1/2)*(a - b)^(1/2))
 

Reduce [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.02 \[ \int \frac {(e x)^{-1+n}}{a+b \csc \left (c+d x^n\right )} \, dx=\frac {e^{n} \left (2 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {\tan \left (\frac {x^{n} d}{2}+\frac {c}{2}\right ) b +a}{\sqrt {-a^{2}+b^{2}}}\right ) b +x^{n} a^{2} d -x^{n} b^{2} d \right )}{a d e n \left (a^{2}-b^{2}\right )} \] Input:

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

Output:

(e**n*(2*sqrt( - a**2 + b**2)*atan((tan((x**n*d + c)/2)*b + a)/sqrt( - a** 
2 + b**2))*b + x**n*a**2*d - x**n*b**2*d))/(a*d*e*n*(a**2 - b**2))