Integrand size = 32, antiderivative size = 97 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {(A-i B) \operatorname {Hypergeometric2F1}\left (1,n,1+n,\frac {1}{2} (1+i \tan (c+d x))\right ) (a+i a \tan (c+d x))^n}{2 d n}-\frac {A \operatorname {Hypergeometric2F1}(1,n,1+n,1+i \tan (c+d x)) (a+i a \tan (c+d x))^n}{d n} \] Output:
1/2*(A-I*B)*hypergeom([1, n],[1+n],1/2+1/2*I*tan(d*x+c))*(a+I*a*tan(d*x+c) )^n/d/n-A*hypergeom([1, n],[1+n],1+I*tan(d*x+c))*(a+I*a*tan(d*x+c))^n/d/n
Time = 0.80 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.28 \[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {(a+i a \tan (c+d x))^n \left ((i A+B) n \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {1}{2} (1+i \tan (c+d x))\right ) (-i+\tan (c+d x))-2 i ((-i A+B) (1+n)+2 A n \operatorname {Hypergeometric2F1}(1,1+n,2+n,1+i \tan (c+d x)) (-i+\tan (c+d x)))\right )}{4 d n (1+n)} \] Input:
Integrate[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]
Output:
((a + I*a*Tan[c + d*x])^n*((I*A + B)*n*Hypergeometric2F1[1, 1 + n, 2 + n, (1 + I*Tan[c + d*x])/2]*(-I + Tan[c + d*x]) - (2*I)*(((-I)*A + B)*(1 + n) + 2*A*n*Hypergeometric2F1[1, 1 + n, 2 + n, 1 + I*Tan[c + d*x]]*(-I + Tan[c + d*x]))))/(4*d*n*(1 + n))
Time = 0.52 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.06, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {3042, 4083, 3042, 3962, 78, 4082, 75}
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 \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a+i a \tan (c+d x))^n (A+B \tan (c+d x))}{\tan (c+d x)}dx\) |
\(\Big \downarrow \) 4083 |
\(\displaystyle (B+i A) \int (i \tan (c+d x) a+a)^ndx+\frac {A \int \cot (c+d x) (a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^ndx}{a}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (B+i A) \int (i \tan (c+d x) a+a)^ndx+\frac {A \int \frac {(a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^n}{\tan (c+d x)}dx}{a}\) |
\(\Big \downarrow \) 3962 |
\(\displaystyle \frac {A \int \frac {(a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^n}{\tan (c+d x)}dx}{a}-\frac {i a (B+i A) \int \frac {(i \tan (c+d x) a+a)^{n-1}}{a-i a \tan (c+d x)}d(i a \tan (c+d x))}{d}\) |
\(\Big \downarrow \) 78 |
\(\displaystyle \frac {A \int \frac {(a-i a \tan (c+d x)) (i \tan (c+d x) a+a)^n}{\tan (c+d x)}dx}{a}-\frac {i (B+i A) (a+i a \tan (c+d x))^n \operatorname {Hypergeometric2F1}\left (1,n,n+1,\frac {i \tan (c+d x) a+a}{2 a}\right )}{2 d n}\) |
\(\Big \downarrow \) 4082 |
\(\displaystyle \frac {a A \int \cot (c+d x) (i \tan (c+d x) a+a)^{n-1}d\tan (c+d x)}{d}-\frac {i (B+i A) (a+i a \tan (c+d x))^n \operatorname {Hypergeometric2F1}\left (1,n,n+1,\frac {i \tan (c+d x) a+a}{2 a}\right )}{2 d n}\) |
\(\Big \downarrow \) 75 |
\(\displaystyle -\frac {i (B+i A) (a+i a \tan (c+d x))^n \operatorname {Hypergeometric2F1}\left (1,n,n+1,\frac {i \tan (c+d x) a+a}{2 a}\right )}{2 d n}-\frac {A (a+i a \tan (c+d x))^n \operatorname {Hypergeometric2F1}(1,n,n+1,i \tan (c+d x)+1)}{d n}\) |
Input:
Int[Cot[c + d*x]*(a + I*a*Tan[c + d*x])^n*(A + B*Tan[c + d*x]),x]
Output:
-((A*Hypergeometric2F1[1, n, 1 + n, 1 + I*Tan[c + d*x]]*(a + I*a*Tan[c + d *x])^n)/(d*n)) - ((I/2)*(I*A + B)*Hypergeometric2F1[1, n, 1 + n, (a + I*a* Tan[c + d*x])/(2*a)]*(a + I*a*Tan[c + d*x])^n)/(d*n)
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((c + d*x )^(n + 1)/(d*(n + 1)*(-d/(b*c))^m))*Hypergeometric2F1[-m, n + 1, n + 2, 1 + d*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] && !IntegerQ[n] && (IntegerQ[m] || GtQ[-d/(b*c), 0])
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b *c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] && !IntegerQ[m] && IntegerQ[n]
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[-b/d S ubst[Int[(a + x)^(n - 1)/(a - x), x], x, b*Tan[c + d*x]], x] /; FreeQ[{a, b , c, d, n}, x] && EqQ[a^2 + b^2, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim p[b*(B/f) Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^n, x], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[ a^2 + b^2, 0] && EqQ[A*b + a*B, 0]
Int[(((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)]))/((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[( A*b + a*B)/(b*c + a*d) Int[(a + b*Tan[e + f*x])^m, x], x] - Simp[(B*c - A *d)/(b*c + a*d) Int[(a + b*Tan[e + f*x])^m*((a - b*Tan[e + f*x])/(c + d*T an[e + f*x])), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[A*b + a*B, 0]
\[\int \cot \left (d x +c \right ) \left (a +i a \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )d x\]
Input:
int(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)
Output:
int(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)
\[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="f ricas")
Output:
integral(((I*A + B)*e^(2*I*d*x + 2*I*c) + I*A - B)*(2*a*e^(2*I*d*x + 2*I*c )/(e^(2*I*d*x + 2*I*c) + 1))^n/(e^(2*I*d*x + 2*I*c) - 1), x)
\[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n} \left (A + B \tan {\left (c + d x \right )}\right ) \cot {\left (c + d x \right )}\, dx \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))**n*(A+B*tan(d*x+c)),x)
Output:
Integral((I*a*(tan(c + d*x) - I))**n*(A + B*tan(c + d*x))*cot(c + d*x), x)
\[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="m axima")
Output:
integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)^n*cot(d*x + c), x)
\[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \cot \left (d x + c\right ) \,d x } \] Input:
integrate(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x, algorithm="g iac")
Output:
integrate((B*tan(d*x + c) + A)*(I*a*tan(d*x + c) + a)^n*cot(d*x + c), x)
Timed out. \[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int \mathrm {cot}\left (c+d\,x\right )\,\left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n \,d x \] Input:
int(cot(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^n,x)
Output:
int(cot(c + d*x)*(A + B*tan(c + d*x))*(a + a*tan(c + d*x)*1i)^n, x)
\[ \int \cot (c+d x) (a+i a \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\left (\int \left (\tan \left (d x +c \right ) a i +a \right )^{n} \cot \left (d x +c \right ) \tan \left (d x +c \right )d x \right ) b +\left (\int \left (\tan \left (d x +c \right ) a i +a \right )^{n} \cot \left (d x +c \right )d x \right ) a \] Input:
int(cot(d*x+c)*(a+I*a*tan(d*x+c))^n*(A+B*tan(d*x+c)),x)
Output:
int((tan(c + d*x)*a*i + a)**n*cot(c + d*x)*tan(c + d*x),x)*b + int((tan(c + d*x)*a*i + a)**n*cot(c + d*x),x)*a