Integrand size = 30, antiderivative size = 113 \[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\frac {i 2^{1+\frac {n}{2}} a \operatorname {Hypergeometric2F1}\left (\frac {2-n}{2},-\frac {n}{2},\frac {4-n}{2},\frac {1}{2} (1-i \tan (c+d x))\right ) (e \sec (c+d x))^{2-n} (1+i \tan (c+d x))^{-n/2} (a+i a \tan (c+d x))^{-1+n}}{d (2-n)} \] Output:
I*2^(1+1/2*n)*a*hypergeom([-1/2*n, 1-1/2*n],[2-1/2*n],1/2-1/2*I*tan(d*x+c) )*(e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^(-1+n)/d/(2-n)/((1+I*tan(d*x+c)) ^(1/2*n))
Time = 8.82 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.99 \[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\frac {4 e^2 \operatorname {Hypergeometric2F1}\left (2,1-\frac {n}{2},2-\frac {n}{2},-\cos (2 (c+d x))+i \sin (2 (c+d x))\right ) (e \sec (c+d x))^{-n} (\cos (2 c)-i \sin (2 c)) (i+\tan (d x)) (a+i a \tan (c+d x))^n}{d (-2+n) (-1-i \tan (d x))} \] Input:
Integrate[(e*Sec[c + d*x])^(2 - n)*(a + I*a*Tan[c + d*x])^n,x]
Output:
(4*e^2*Hypergeometric2F1[2, 1 - n/2, 2 - n/2, -Cos[2*(c + d*x)] + I*Sin[2* (c + d*x)]]*(Cos[2*c] - I*Sin[2*c])*(I + Tan[d*x])*(a + I*a*Tan[c + d*x])^ n)/(d*(-2 + n)*(e*Sec[c + d*x])^n*(-1 - I*Tan[d*x]))
Time = 0.51 (sec) , antiderivative size = 146, normalized size of antiderivative = 1.29, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3042, 3986, 3042, 4006, 80, 79}
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+i a \tan (c+d x))^n (e \sec (c+d x))^{2-n} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (c+d x))^n (e \sec (c+d x))^{2-n}dx\) |
\(\Big \downarrow \) 3986 |
\(\displaystyle (a-i a \tan (c+d x))^{\frac {n-2}{2}} (a+i a \tan (c+d x))^{\frac {n-2}{2}} (e \sec (c+d x))^{2-n} \int (a-i a \tan (c+d x))^{\frac {2-n}{2}} (i \tan (c+d x) a+a)^{\frac {n+2}{2}}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle (a-i a \tan (c+d x))^{\frac {n-2}{2}} (a+i a \tan (c+d x))^{\frac {n-2}{2}} (e \sec (c+d x))^{2-n} \int (a-i a \tan (c+d x))^{\frac {2-n}{2}} (i \tan (c+d x) a+a)^{\frac {n+2}{2}}dx\) |
\(\Big \downarrow \) 4006 |
\(\displaystyle \frac {a^2 (a-i a \tan (c+d x))^{\frac {n-2}{2}} (a+i a \tan (c+d x))^{\frac {n-2}{2}} (e \sec (c+d x))^{2-n} \int (a-i a \tan (c+d x))^{-n/2} (i \tan (c+d x) a+a)^{n/2}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 80 |
\(\displaystyle \frac {a^2 2^{-n/2} (1-i \tan (c+d x))^{n/2} (a-i a \tan (c+d x))^{\frac {n-2}{2}-\frac {n}{2}} (a+i a \tan (c+d x))^{\frac {n-2}{2}} (e \sec (c+d x))^{2-n} \int \left (\frac {1}{2}-\frac {1}{2} i \tan (c+d x)\right )^{-n/2} (i \tan (c+d x) a+a)^{n/2}d\tan (c+d x)}{d}\) |
\(\Big \downarrow \) 79 |
\(\displaystyle -\frac {i a 2^{1-\frac {n}{2}} (1-i \tan (c+d x))^{n/2} (a-i a \tan (c+d x))^{\frac {n-2}{2}-\frac {n}{2}} (a+i a \tan (c+d x))^{\frac {n-2}{2}+\frac {n+2}{2}} (e \sec (c+d x))^{2-n} \operatorname {Hypergeometric2F1}\left (\frac {n}{2},\frac {n+2}{2},\frac {n+4}{2},\frac {1}{2} (i \tan (c+d x)+1)\right )}{d (n+2)}\) |
Input:
Int[(e*Sec[c + d*x])^(2 - n)*(a + I*a*Tan[c + d*x])^n,x]
Output:
((-I)*2^(1 - n/2)*a*Hypergeometric2F1[n/2, (2 + n)/2, (4 + n)/2, (1 + I*Ta n[c + d*x])/2]*(e*Sec[c + d*x])^(2 - n)*(1 - I*Tan[c + d*x])^(n/2)*(a - I* a*Tan[c + d*x])^((-2 + n)/2 - n/2)*(a + I*a*Tan[c + d*x])^((-2 + n)/2 + (2 + n)/2))/(d*(2 + n))
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(( a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c - a*d))^n))*Hypergeometric2F1[-n, m + 1 , m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}, x] && !IntegerQ[m] && !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] || !(RationalQ[n] && GtQ[-d/(b*c - a*d), 0]))
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(c + d*x)^FracPart[n]/((b/(b*c - a*d))^IntPart[n]*(b*((c + d*x)/(b*c - a*d))) ^FracPart[n]) Int[(a + b*x)^m*Simp[b*(c/(b*c - a*d)) + b*d*(x/(b*c - a*d) ), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && !IntegerQ[m] && !Integ erQ[n] && (RationalQ[m] || !SimplerQ[n + 1, m + 1])
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)])^(n_.), x_Symbol] :> Simp[(d*Sec[e + f*x])^m/((a + b*Tan[e + f*x])^(m/ 2)*(a - b*Tan[e + f*x])^(m/2)) Int[(a + b*Tan[e + f*x])^(m/2 + n)*(a - b* Tan[e + f*x])^(m/2), x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + ( f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(c/f) Subst[Int[(a + b*x)^(m - 1)*( c + d*x)^(n - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n }, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
\[\int \left (e \sec \left (d x +c \right )\right )^{2-n} \left (a +i a \tan \left (d x +c \right )\right )^{n}d x\]
Input:
int((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x)
Output:
int((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x)
\[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\int { \left (e \sec \left (d x + c\right )\right )^{-n + 2} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")
Output:
1/2*((2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1))^(-n + 2)*(I*e^(2*I*d* x + 2*I*c) + I)*e^(I*d*n*x + I*c*n + n*log(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1)) + n*log(a/e)) + 2*d*e^(2*I*d*x + 2*I*c)*integral(1/2*(n*e^ (2*I*d*x + 2*I*c) + n)*(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1))^(-n + 2)*e^(I*d*n*x + I*c*n - 2*I*d*x + n*log(2*e*e^(I*d*x + I*c)/(e^(2*I*d*x + 2*I*c) + 1)) + n*log(a/e) - 2*I*c), x))*e^(-2*I*d*x - 2*I*c)/d
\[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\int \left (e \sec {\left (c + d x \right )}\right )^{2 - n} \left (i a \left (\tan {\left (c + d x \right )} - i\right )\right )^{n}\, dx \] Input:
integrate((e*sec(d*x+c))**(2-n)*(a+I*a*tan(d*x+c))**n,x)
Output:
Integral((e*sec(c + d*x))**(2 - n)*(I*a*(tan(c + d*x) - I))**n, x)
\[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\int { \left (e \sec \left (d x + c\right )\right )^{-n + 2} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")
Output:
4*(4*a^n*e^2*cos(d*n*x + c*n) + 4*I*a^n*e^2*sin(d*n*x + c*n) - (a^n*e^2*n - 4*a^n*e^2)*cos(c*n + (d*n + 2*d)*x + 2*c) - 4*(I*a^n*d*e^(n + 2)*n^3 - 6 *I*a^n*d*e^(n + 2)*n^2 + 8*I*a^n*d*e^(n + 2)*n + (I*a^n*d*e^(n + 2)*n^3 - 6*I*a^n*d*e^(n + 2)*n^2 + 8*I*a^n*d*e^(n + 2)*n)*cos(4*d*x + 4*c) + 2*(I*a ^n*d*e^(n + 2)*n^3 - 6*I*a^n*d*e^(n + 2)*n^2 + 8*I*a^n*d*e^(n + 2)*n)*cos( 2*d*x + 2*c) - (a^n*d*e^(n + 2)*n^3 - 6*a^n*d*e^(n + 2)*n^2 + 8*a^n*d*e^(n + 2)*n)*sin(4*d*x + 4*c) - 2*(a^n*d*e^(n + 2)*n^3 - 6*a^n*d*e^(n + 2)*n^2 + 8*a^n*d*e^(n + 2)*n)*sin(2*d*x + 2*c))*integrate(((cos(6*d*x + 6*c) + 3 *cos(4*d*x + 4*c) + 3*cos(2*d*x + 2*c) + 1)*cos(d*n*x + c*n) + (sin(6*d*x + 6*c) + 3*sin(4*d*x + 4*c) + 3*sin(2*d*x + 2*c))*sin(d*n*x + c*n))/(e^n*n ^2 + (e^n*n^2 - 6*e^n*n + 8*e^n)*cos(6*d*x + 6*c)^2 + 9*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(4*d*x + 4*c)^2 + 9*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(2*d*x + 2 *c)^2 + (e^n*n^2 - 6*e^n*n + 8*e^n)*sin(6*d*x + 6*c)^2 + 9*(e^n*n^2 - 6*e^ n*n + 8*e^n)*sin(4*d*x + 4*c)^2 + 18*(e^n*n^2 - 6*e^n*n + 8*e^n)*sin(4*d*x + 4*c)*sin(2*d*x + 2*c) + 9*(e^n*n^2 - 6*e^n*n + 8*e^n)*sin(2*d*x + 2*c)^ 2 - 6*e^n*n + 2*(e^n*n^2 - 6*e^n*n + 3*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(4*d *x + 4*c) + 3*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(2*d*x + 2*c) + 8*e^n)*cos(6* d*x + 6*c) + 6*(e^n*n^2 - 6*e^n*n + 3*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(2*d* x + 2*c) + 8*e^n)*cos(4*d*x + 4*c) + 6*(e^n*n^2 - 6*e^n*n + 8*e^n)*cos(2*d *x + 2*c) + 6*((e^n*n^2 - 6*e^n*n + 8*e^n)*sin(4*d*x + 4*c) + (e^n*n^2 ...
\[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\int { \left (e \sec \left (d x + c\right )\right )^{-n + 2} {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \] Input:
integrate((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")
Output:
integrate((e*sec(d*x + c))^(-n + 2)*(I*a*tan(d*x + c) + a)^n, x)
Timed out. \[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\int {\left (\frac {e}{\cos \left (c+d\,x\right )}\right )}^{2-n}\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^n \,d x \] Input:
int((e/cos(c + d*x))^(2 - n)*(a + a*tan(c + d*x)*1i)^n,x)
Output:
int((e/cos(c + d*x))^(2 - n)*(a + a*tan(c + d*x)*1i)^n, x)
\[ \int (e \sec (c+d x))^{2-n} (a+i a \tan (c+d x))^n \, dx=\frac {\left (\int \frac {\left (\tan \left (d x +c \right ) a i +a \right )^{n} \sec \left (d x +c \right )^{2}}{\sec \left (d x +c \right )^{n}}d x \right ) e^{2}}{e^{n}} \] Input:
int((e*sec(d*x+c))^(2-n)*(a+I*a*tan(d*x+c))^n,x)
Output:
(int(((tan(c + d*x)*a*i + a)**n*sec(c + d*x)**2)/sec(c + d*x)**n,x)*e**2)/ e**n