\(\int (-((1+b^2 n^2) \csc (a+b \log (c x^n)))+2 b^2 n^2 \csc ^3(a+b \log (c x^n))) \, dx\) [301]

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

Optimal result

Integrand size = 44, antiderivative size = 42 \[ \int \left (-\left (\left (1+b^2 n^2\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right )+2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-x \csc \left (a+b \log \left (c x^n\right )\right )-b n x \cot \left (a+b \log \left (c x^n\right )\right ) \csc \left (a+b \log \left (c x^n\right )\right ) \] Output:

-x*csc(a+b*ln(c*x^n))-b*n*x*cot(a+b*ln(c*x^n))*csc(a+b*ln(c*x^n))
 

Mathematica [A] (verified)

Time = 0.46 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.71 \[ \int \left (-\left (\left (1+b^2 n^2\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right )+2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-x \left (1+b n \cot \left (a+b \log \left (c x^n\right )\right )\right ) \csc \left (a+b \log \left (c x^n\right )\right ) \] Input:

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

Output:

-(x*(1 + b*n*Cot[a + b*Log[c*x^n]])*Csc[a + b*Log[c*x^n]])
 

Rubi [C] (verified)

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

Time = 0.33 (sec) , antiderivative size = 172, normalized size of antiderivative = 4.10, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.023, Rules used = {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 \left (2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )-\left (b^2 n^2+1\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right ) \, dx\)

\(\Big \downarrow \) 2009

\(\displaystyle 2 e^{i a} x (b n+i) \left (c x^n\right )^{i b} \operatorname {Hypergeometric2F1}\left (1,\frac {1}{2} \left (1-\frac {i}{b n}\right ),\frac {1}{2} \left (3-\frac {i}{b n}\right ),e^{2 i a} \left (c x^n\right )^{2 i b}\right )-\frac {16 e^{3 i a} b^2 n^2 x \left (c x^n\right )^{3 i b} \operatorname {Hypergeometric2F1}\left (3,\frac {1}{2} \left (3-\frac {i}{b n}\right ),\frac {1}{2} \left (5-\frac {i}{b n}\right ),e^{2 i a} \left (c x^n\right )^{2 i b}\right )}{-3 b n+i}\)

Input:

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

Output:

2*E^(I*a)*(I + b*n)*x*(c*x^n)^(I*b)*Hypergeometric2F1[1, (1 - I/(b*n))/2, 
(3 - I/(b*n))/2, E^((2*I)*a)*(c*x^n)^((2*I)*b)] - (16*b^2*E^((3*I)*a)*n^2* 
x*(c*x^n)^((3*I)*b)*Hypergeometric2F1[3, (3 - I/(b*n))/2, (5 - I/(b*n))/2, 
 E^((2*I)*a)*(c*x^n)^((2*I)*b)])/(I - 3*b*n)
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 
Maple [A] (verified)

Time = 14.75 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.90

method result size
parallelrisch \(-\frac {x \left (-b n {\tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )}^{2}+2 \tan \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )+{\cot \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )}^{2} b n +2 \cot \left (\frac {a}{2}+b \ln \left (\sqrt {c \,x^{n}}\right )\right )\right )}{4}\) \(80\)
risch \(\frac {2 \left (x^{n}\right )^{i b} c^{i b} x \left (n b \,c^{2 i b} \left (x^{n}\right )^{2 i b} {\mathrm e}^{\frac {3 b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {3 b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{-\frac {3 b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {3 b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{3 i a}+b n \,{\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}-i \left (x^{n}\right )^{2 i b} c^{2 i b} {\mathrm e}^{\frac {3 b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {3 b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{-\frac {3 b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {3 b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{3 i a}+i {\mathrm e}^{-\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}}{2}} {\mathrm e}^{\frac {b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}}{2}} {\mathrm e}^{-\frac {b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )}{2}} {\mathrm e}^{i a}\right )}{{\left (\left (x^{n}\right )^{2 i b} c^{2 i b} {\mathrm e}^{-b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}} {\mathrm e}^{b \pi \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) \operatorname {csgn}\left (i c \right )} {\mathrm e}^{b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{-b \pi \operatorname {csgn}\left (i c \,x^{n}\right )^{2} \operatorname {csgn}\left (i c \right )} {\mathrm e}^{2 i a}-1\right )}^{2}}\) \(523\)

Input:

int(-(b^2*n^2+1)*csc(a+b*ln(c*x^n))+2*b^2*n^2*csc(a+b*ln(c*x^n))^3,x,metho 
d=_RETURNVERBOSE)
 

Output:

-1/4*x*(-b*n*tan(1/2*a+b*ln((c*x^n)^(1/2)))^2+2*tan(1/2*a+b*ln((c*x^n)^(1/ 
2)))+cot(1/2*a+b*ln((c*x^n)^(1/2)))^2*b*n+2*cot(1/2*a+b*ln((c*x^n)^(1/2))) 
)
 

Fricas [A] (verification not implemented)

Time = 0.07 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.19 \[ \int \left (-\left (\left (1+b^2 n^2\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right )+2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {b n x \cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + x \sin \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{\cos \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} - 1} \] Input:

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

Output:

(b*n*x*cos(b*n*log(x) + b*log(c) + a) + x*sin(b*n*log(x) + b*log(c) + a))/ 
(cos(b*n*log(x) + b*log(c) + a)^2 - 1)
 

Sympy [F]

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1701 vs. \(2 (42) = 84\).

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

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

Output:

2*((b*n*cos(b*log(c)) - sin(b*log(c)))*x*cos(b*log(x^n) + a) - (b*n*sin(b* 
log(c)) + cos(b*log(c)))*x*sin(b*log(x^n) + a) + (((b*cos(4*b*log(c))*cos( 
3*b*log(c)) + b*sin(4*b*log(c))*sin(3*b*log(c)))*n - cos(3*b*log(c))*sin(4 
*b*log(c)) + cos(4*b*log(c))*sin(3*b*log(c)))*x*cos(3*b*log(x^n) + 3*a) + 
((b*cos(4*b*log(c))*cos(b*log(c)) + b*sin(4*b*log(c))*sin(b*log(c)))*n + c 
os(b*log(c))*sin(4*b*log(c)) - cos(4*b*log(c))*sin(b*log(c)))*x*cos(b*log( 
x^n) + a) + ((b*cos(3*b*log(c))*sin(4*b*log(c)) - b*cos(4*b*log(c))*sin(3* 
b*log(c)))*n + cos(4*b*log(c))*cos(3*b*log(c)) + sin(4*b*log(c))*sin(3*b*l 
og(c)))*x*sin(3*b*log(x^n) + 3*a) + ((b*cos(b*log(c))*sin(4*b*log(c)) - b* 
cos(4*b*log(c))*sin(b*log(c)))*n - cos(4*b*log(c))*cos(b*log(c)) - sin(4*b 
*log(c))*sin(b*log(c)))*x*sin(b*log(x^n) + a))*cos(4*b*log(x^n) + 4*a) - ( 
2*((b*cos(3*b*log(c))*cos(2*b*log(c)) + b*sin(3*b*log(c))*sin(2*b*log(c))) 
*n + cos(2*b*log(c))*sin(3*b*log(c)) - cos(3*b*log(c))*sin(2*b*log(c)))*x* 
cos(2*b*log(x^n) + 2*a) + 2*((b*cos(2*b*log(c))*sin(3*b*log(c)) - b*cos(3* 
b*log(c))*sin(2*b*log(c)))*n - cos(3*b*log(c))*cos(2*b*log(c)) - sin(3*b*l 
og(c))*sin(2*b*log(c)))*x*sin(2*b*log(x^n) + 2*a) - (b*n*cos(3*b*log(c)) + 
 sin(3*b*log(c)))*x)*cos(3*b*log(x^n) + 3*a) - 2*(((b*cos(2*b*log(c))*cos( 
b*log(c)) + b*sin(2*b*log(c))*sin(b*log(c)))*n + cos(b*log(c))*sin(2*b*log 
(c)) - cos(2*b*log(c))*sin(b*log(c)))*x*cos(b*log(x^n) + a) + ((b*cos(b*lo 
g(c))*sin(2*b*log(c)) - b*cos(2*b*log(c))*sin(b*log(c)))*n - cos(2*b*lo...
 

Giac [F]

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

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

Output:

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

Mupad [B] (verification not implemented)

Time = 23.73 (sec) , antiderivative size = 85, normalized size of antiderivative = 2.02 \[ \int \left (-\left (\left (1+b^2 n^2\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right )+2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )\right ) \, dx=\frac {2\,x\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}\,\left (b\,n+1{}\mathrm {i}\right )+2\,x\,{\mathrm {e}}^{a\,1{}\mathrm {i}}\,{\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,1{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}\,\left (b\,n-\mathrm {i}\right )}{{\left ({\mathrm {e}}^{a\,2{}\mathrm {i}}\,{\left (c\,x^n\right )}^{b\,2{}\mathrm {i}}-1\right )}^2} \] Input:

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 42, normalized size of antiderivative = 1.00 \[ \int \left (-\left (\left (1+b^2 n^2\right ) \csc \left (a+b \log \left (c x^n\right )\right )\right )+2 b^2 n^2 \csc ^3\left (a+b \log \left (c x^n\right )\right )\right ) \, dx=-\frac {x \left (\cos \left (\mathrm {log}\left (x^{n} c \right ) b +a \right ) b n +\sin \left (\mathrm {log}\left (x^{n} c \right ) b +a \right )\right )}{{\sin \left (\mathrm {log}\left (x^{n} c \right ) b +a \right )}^{2}} \] Input:

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

Output:

( - x*(cos(log(x**n*c)*b + a)*b*n + sin(log(x**n*c)*b + a)))/sin(log(x**n* 
c)*b + a)**2