Integrand size = 12, antiderivative size = 167 \[ \int (a+b \cot (c+d x))^n \, dx=-\frac {b (a+b \cot (c+d x))^{1+n} \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \cot (c+d x)}{a-\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} \left (a-\sqrt {-b^2}\right ) d (1+n)}+\frac {b (a+b \cot (c+d x))^{1+n} \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \cot (c+d x)}{a+\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} \left (a+\sqrt {-b^2}\right ) d (1+n)} \] Output:
-1/2*b*(a+b*cot(d*x+c))^(1+n)*hypergeom([1, 1+n],[2+n],(a+b*cot(d*x+c))/(a -(-b^2)^(1/2)))/(-b^2)^(1/2)/(a-(-b^2)^(1/2))/d/(1+n)+1/2*b*(a+b*cot(d*x+c ))^(1+n)*hypergeom([1, 1+n],[2+n],(a+b*cot(d*x+c))/(a+(-b^2)^(1/2)))/(-b^2 )^(1/2)/(a+(-b^2)^(1/2))/d/(1+n)
Result contains complex when optimal does not.
Time = 0.23 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.71 \[ \int (a+b \cot (c+d x))^n \, dx=\frac {(a+b \cot (c+d x))^{1+n} \left ((a+i b) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \cot (c+d x)}{a-i b}\right )-(a-i b) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \cot (c+d x)}{a+i b}\right )\right )}{2 (a-i b) (-i a+b) d (1+n)} \] Input:
Integrate[(a + b*Cot[c + d*x])^n,x]
Output:
((a + b*Cot[c + d*x])^(1 + n)*((a + I*b)*Hypergeometric2F1[1, 1 + n, 2 + n , (a + b*Cot[c + d*x])/(a - I*b)] - (a - I*b)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Cot[c + d*x])/(a + I*b)]))/(2*(a - I*b)*((-I)*a + b)*d*(1 + n))
Time = 0.43 (sec) , antiderivative size = 165, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3966, 485, 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 (a+b \cot (c+d x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a-b \tan \left (c+d x+\frac {\pi }{2}\right )\right )^ndx\) |
\(\Big \downarrow \) 3966 |
\(\displaystyle -\frac {b \int \frac {(a+b \cot (c+d x))^n}{\cot ^2(c+d x) b^2+b^2}d(b \cot (c+d x))}{d}\) |
\(\Big \downarrow \) 485 |
\(\displaystyle -\frac {b \int \left (\frac {\sqrt {-b^2} (a+b \cot (c+d x))^n}{2 b^2 \left (\sqrt {-b^2}-b \cot (c+d x)\right )}+\frac {\sqrt {-b^2} (a+b \cot (c+d x))^n}{2 b^2 \left (b \cot (c+d x)+\sqrt {-b^2}\right )}\right )d(b \cot (c+d x))}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {b \left (\frac {(a+b \cot (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \cot (c+d x)}{a-\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} (n+1) \left (a-\sqrt {-b^2}\right )}-\frac {(a+b \cot (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \cot (c+d x)}{a+\sqrt {-b^2}}\right )}{2 \sqrt {-b^2} (n+1) \left (a+\sqrt {-b^2}\right )}\right )}{d}\) |
Input:
Int[(a + b*Cot[c + d*x])^n,x]
Output:
-((b*(((a + b*Cot[c + d*x])^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Cot[c + d*x])/(a - Sqrt[-b^2])])/(2*Sqrt[-b^2]*(a - Sqrt[-b^2])*(1 + n )) - ((a + b*Cot[c + d*x])^(1 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Cot[c + d*x])/(a + Sqrt[-b^2])])/(2*Sqrt[-b^2]*(a + Sqrt[-b^2])*(1 + n) )))/d)
Int[((c_) + (d_.)*(x_))^(n_)/((a_) + (b_.)*(x_)^2), x_Symbol] :> Int[Expand Integrand[(c + d*x)^n, 1/(a + b*x^2), x], x] /; FreeQ[{a, b, c, d, n}, x] & & !IntegerQ[2*n]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d Su bst[Int[(a + x)^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c , d, n}, x] && NeQ[a^2 + b^2, 0]
\[\int \left (a +b \cot \left (d x +c \right )\right )^{n}d x\]
Input:
int((a+b*cot(d*x+c))^n,x)
Output:
int((a+b*cot(d*x+c))^n,x)
\[ \int (a+b \cot (c+d x))^n \, dx=\int { {\left (b \cot \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((a+b*cot(d*x+c))^n,x, algorithm="fricas")
Output:
integral((b*cot(d*x + c) + a)^n, x)
\[ \int (a+b \cot (c+d x))^n \, dx=\int \left (a + b \cot {\left (c + d x \right )}\right )^{n}\, dx \] Input:
integrate((a+b*cot(d*x+c))**n,x)
Output:
Integral((a + b*cot(c + d*x))**n, x)
\[ \int (a+b \cot (c+d x))^n \, dx=\int { {\left (b \cot \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((a+b*cot(d*x+c))^n,x, algorithm="maxima")
Output:
integrate((b*cot(d*x + c) + a)^n, x)
\[ \int (a+b \cot (c+d x))^n \, dx=\int { {\left (b \cot \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((a+b*cot(d*x+c))^n,x, algorithm="giac")
Output:
integrate((b*cot(d*x + c) + a)^n, x)
Timed out. \[ \int (a+b \cot (c+d x))^n \, dx=\int {\left (a+b\,\mathrm {cot}\left (c+d\,x\right )\right )}^n \,d x \] Input:
int((a + b*cot(c + d*x))^n,x)
Output:
int((a + b*cot(c + d*x))^n, x)
\[ \int (a+b \cot (c+d x))^n \, dx=\int \left (\cot \left (d x +c \right ) b +a \right )^{n}d x \] Input:
int((a+b*cot(d*x+c))^n,x)
Output:
int((cot(c + d*x)*b + a)**n,x)