Integrand size = 26, antiderivative size = 189 \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=-\frac {2 a^4 \left (16+11 n+2 n^2\right ) (d \tan (e+f x))^{1+n}}{d f (1+n) (2+n) (3+n)}+\frac {8 a^4 \operatorname {Hypergeometric2F1}(1,1+n,2+n,i \tan (e+f x)) (d \tan (e+f x))^{1+n}}{d f (1+n)}-\frac {(d \tan (e+f x))^{1+n} \left (a^2+i a^2 \tan (e+f x)\right )^2}{d f (3+n)}-\frac {2 (4+n) (d \tan (e+f x))^{1+n} \left (a^4+i a^4 \tan (e+f x)\right )}{d f (2+n) (3+n)} \] Output:
-2*a^4*(2*n^2+11*n+16)*(d*tan(f*x+e))^(1+n)/d/f/(1+n)/(2+n)/(3+n)+8*a^4*hy pergeom([1, 1+n],[2+n],I*tan(f*x+e))*(d*tan(f*x+e))^(1+n)/d/f/(1+n)-(d*tan (f*x+e))^(1+n)*(a^2+I*a^2*tan(f*x+e))^2/d/f/(3+n)-2*(4+n)*(d*tan(f*x+e))^( 1+n)*(a^4+I*a^4*tan(f*x+e))/d/f/(2+n)/(3+n)
Time = 0.66 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.59 \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\frac {a^4 \tan (e+f x) (d \tan (e+f x))^n \left (-7 \left (6+5 n+n^2\right )+8 \left (6+5 n+n^2\right ) \operatorname {Hypergeometric2F1}(1,1+n,2+n,i \tan (e+f x))-4 i \left (3+4 n+n^2\right ) \tan (e+f x)+\left (2+3 n+n^2\right ) \tan ^2(e+f x)\right )}{f (1+n) (2+n) (3+n)} \] Input:
Integrate[(d*Tan[e + f*x])^n*(a + I*a*Tan[e + f*x])^4,x]
Output:
(a^4*Tan[e + f*x]*(d*Tan[e + f*x])^n*(-7*(6 + 5*n + n^2) + 8*(6 + 5*n + n^ 2)*Hypergeometric2F1[1, 1 + n, 2 + n, I*Tan[e + f*x]] - (4*I)*(3 + 4*n + n ^2)*Tan[e + f*x] + (2 + 3*n + n^2)*Tan[e + f*x]^2))/(f*(1 + n)*(2 + n)*(3 + n))
Time = 1.10 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.03, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.462, Rules used = {3042, 4039, 27, 3042, 4077, 3042, 4075, 3042, 4020, 25, 27, 74}
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 (e+f x))^4 (d \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (e+f x))^4 (d \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4039 |
\(\displaystyle \frac {a \int 2 (d \tan (e+f x))^n (i \tan (e+f x) a+a)^2 (a d (n+2)+i a d (n+4) \tan (e+f x))dx}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2 a \int (d \tan (e+f x))^n (i \tan (e+f x) a+a)^2 (a d (n+2)+i a d (n+4) \tan (e+f x))dx}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 a \int (d \tan (e+f x))^n (i \tan (e+f x) a+a)^2 (a d (n+2)+i a d (n+4) \tan (e+f x))dx}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 4077 |
\(\displaystyle \frac {2 a \left (\frac {\int (d \tan (e+f x))^n (i \tan (e+f x) a+a) \left (a^2 \left (2 n^2+9 n+8\right ) d^2+i a^2 \left (2 n^2+11 n+16\right ) \tan (e+f x) d^2\right )dx}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 a \left (\frac {\int (d \tan (e+f x))^n (i \tan (e+f x) a+a) \left (a^2 \left (2 n^2+9 n+8\right ) d^2+i a^2 \left (2 n^2+11 n+16\right ) \tan (e+f x) d^2\right )dx}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 4075 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}+\int (d \tan (e+f x))^n \left (4 d^2 (n+2) (n+3) a^3+4 i d^2 (n+2) (n+3) \tan (e+f x) a^3\right )dx}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}+\int (d \tan (e+f x))^n \left (4 d^2 (n+2) (n+3) a^3+4 i d^2 (n+2) (n+3) \tan (e+f x) a^3\right )dx}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 4020 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}+\frac {16 i a^6 d^4 (n+2)^2 (n+3)^2 \int -\frac {(d \tan (e+f x))^n}{4 a^3 d^2 (n+2) (n+3) \left (4 a^3 d^2 (n+2) (n+3)-4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)\right )}d\left (4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)\right )}{f}}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}-\frac {16 i a^6 d^4 (n+2)^2 (n+3)^2 \int \frac {(d \tan (e+f x))^n}{4 a^3 d^2 (n+2) (n+3) \left (4 a^3 d^2 (n+2) (n+3)-4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)\right )}d\left (4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)\right )}{f}}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}-\frac {i a^3 d^2 4^{1-n} (n+2) (n+3) \int \frac {4^n (d \tan (e+f x))^n}{4 a^3 d^2 (n+2) (n+3)-4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)}d\left (4 i a^3 d^2 (n+2) (n+3) \tan (e+f x)\right )}{f}}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
\(\Big \downarrow \) 74 |
\(\displaystyle \frac {2 a \left (\frac {-\frac {a^3 d \left (2 n^2+11 n+16\right ) (d \tan (e+f x))^{n+1}}{f (n+1)}+\frac {4 a^3 d (n+2) (n+3) (d \tan (e+f x))^{n+1} \operatorname {Hypergeometric2F1}(1,n+1,n+2,i \tan (e+f x))}{f (n+1)}}{d (n+2)}-\frac {(n+4) \left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{f (n+2)}\right )}{d (n+3)}-\frac {\left (a^2+i a^2 \tan (e+f x)\right )^2 (d \tan (e+f x))^{n+1}}{d f (n+3)}\) |
Input:
Int[(d*Tan[e + f*x])^n*(a + I*a*Tan[e + f*x])^4,x]
Output:
-(((d*Tan[e + f*x])^(1 + n)*(a^2 + I*a^2*Tan[e + f*x])^2)/(d*f*(3 + n))) + (2*a*(-(((4 + n)*(d*Tan[e + f*x])^(1 + n)*(a^3 + I*a^3*Tan[e + f*x]))/(f* (2 + n))) + (-((a^3*d*(16 + 11*n + 2*n^2)*(d*Tan[e + f*x])^(1 + n))/(f*(1 + n))) + (4*a^3*d*(2 + n)*(3 + n)*Hypergeometric2F1[1, 1 + n, 2 + n, I*Tan [e + f*x]]*(d*Tan[e + f*x])^(1 + n))/(f*(1 + n)))/(d*(2 + n))))/(d*(3 + n) )
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[c^n*((b*x )^(m + 1)/(b*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*(x/c)], x] /; FreeQ[{b, c, d, m, n}, x] && !IntegerQ[m] && (IntegerQ[n] || (GtQ[c, 0] && !(EqQ[n, -2^(-1)] && EqQ[c^2 - d^2, 0] && GtQ[-d/(b*c), 0])))
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f) Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b^2*(a + b*Tan[e + f*x])^(m - 2)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n - 1))), x] + Simp[a/(d*(m + n - 1)) Int[(a + b*Tan[e + f*x])^(m - 2)*(c + d*Tan[e + f*x])^n*Simp[b*c*(m - 2) + a*d*(m + 2*n) + (a*c*(m - 2) + b*d*(3*m + 2*n - 4))*Tan[e + f*x], x], x], x ] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && IntegerQ[2*m] && GtQ[m, 1] && NeQ[m + n - 1, 0] && (IntegerQ[m] || IntegersQ[2*m, 2*n])
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[B *d*((a + b*Tan[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Int[(a + b*Tan[e + f* x])^m*Simp[A*c - B*d + (B*c + A*d)*Tan[e + f*x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0] && !LeQ[m, -1]
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*(a + b*Tan[e + f*x])^(m - 1)*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(m + n))), x] + Simp[1/(d*(m + n)) Int[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan [e + f*x])^n*Simp[a*A*d*(m + n) + B*(a*c*(m - 1) - b*d*(n + 1)) - (B*(b*c - a*d)*(m - 1) - d*(A*b + a*B)*(m + n))*Tan[e + f*x], x], x], x] /; FreeQ[{a , b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && GtQ[m, 1] && !LtQ[n, -1]
\[\int \left (d \tan \left (f x +e \right )\right )^{n} \left (a +i a \tan \left (f x +e \right )\right )^{4}d x\]
Input:
int((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x)
Output:
int((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{4} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x, algorithm="fricas")
Output:
integral(16*a^4*((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) + 1 ))^n*e^(8*I*f*x + 8*I*e)/(e^(8*I*f*x + 8*I*e) + 4*e^(6*I*f*x + 6*I*e) + 6* e^(4*I*f*x + 4*I*e) + 4*e^(2*I*f*x + 2*I*e) + 1), x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=a^{4} \left (\int \left (d \tan {\left (e + f x \right )}\right )^{n}\, dx + \int \left (- 6 \left (d \tan {\left (e + f x \right )}\right )^{n} \tan ^{2}{\left (e + f x \right )}\right )\, dx + \int \left (d \tan {\left (e + f x \right )}\right )^{n} \tan ^{4}{\left (e + f x \right )}\, dx + \int 4 i \left (d \tan {\left (e + f x \right )}\right )^{n} \tan {\left (e + f x \right )}\, dx + \int \left (- 4 i \left (d \tan {\left (e + f x \right )}\right )^{n} \tan ^{3}{\left (e + f x \right )}\right )\, dx\right ) \] Input:
integrate((d*tan(f*x+e))**n*(a+I*a*tan(f*x+e))**4,x)
Output:
a**4*(Integral((d*tan(e + f*x))**n, x) + Integral(-6*(d*tan(e + f*x))**n*t an(e + f*x)**2, x) + Integral((d*tan(e + f*x))**n*tan(e + f*x)**4, x) + In tegral(4*I*(d*tan(e + f*x))**n*tan(e + f*x), x) + Integral(-4*I*(d*tan(e + f*x))**n*tan(e + f*x)**3, x))
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{4} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x, algorithm="maxima")
Output:
integrate((I*a*tan(f*x + e) + a)^4*(d*tan(f*x + e))^n, x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{4} \left (d \tan \left (f x + e\right )\right )^{n} \,d x } \] Input:
integrate((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x, algorithm="giac")
Output:
integrate((I*a*tan(f*x + e) + a)^4*(d*tan(f*x + e))^n, x)
Timed out. \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\int {\left (d\,\mathrm {tan}\left (e+f\,x\right )\right )}^n\,{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^4 \,d x \] Input:
int((d*tan(e + f*x))^n*(a + a*tan(e + f*x)*1i)^4,x)
Output:
int((d*tan(e + f*x))^n*(a + a*tan(e + f*x)*1i)^4, x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^4 \, dx=\frac {d^{n} a^{4} \left (-4 \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{2} i n +8 \tan \left (f x +e \right )^{n} i n +16 \tan \left (f x +e \right )^{n} i +\left (\int \tan \left (f x +e \right )^{n}d x \right ) f \,n^{2}+2 \left (\int \tan \left (f x +e \right )^{n}d x \right ) f n -8 \left (\int \frac {\tan \left (f x +e \right )^{n}}{\tan \left (f x +e \right )}d x \right ) f i \,n^{2}-16 \left (\int \frac {\tan \left (f x +e \right )^{n}}{\tan \left (f x +e \right )}d x \right ) f i n +\left (\int \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{4}d x \right ) f \,n^{2}+2 \left (\int \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{4}d x \right ) f n -6 \left (\int \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{2}d x \right ) f \,n^{2}-12 \left (\int \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{2}d x \right ) f n \right )}{f n \left (n +2\right )} \] Input:
int((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^4,x)
Output:
(d**n*a**4*( - 4*tan(e + f*x)**n*tan(e + f*x)**2*i*n + 8*tan(e + f*x)**n*i *n + 16*tan(e + f*x)**n*i + int(tan(e + f*x)**n,x)*f*n**2 + 2*int(tan(e + f*x)**n,x)*f*n - 8*int(tan(e + f*x)**n/tan(e + f*x),x)*f*i*n**2 - 16*int(t an(e + f*x)**n/tan(e + f*x),x)*f*i*n + int(tan(e + f*x)**n*tan(e + f*x)**4 ,x)*f*n**2 + 2*int(tan(e + f*x)**n*tan(e + f*x)**4,x)*f*n - 6*int(tan(e + f*x)**n*tan(e + f*x)**2,x)*f*n**2 - 12*int(tan(e + f*x)**n*tan(e + f*x)**2 ,x)*f*n))/(f*n*(n + 2))