Integrand size = 26, antiderivative size = 127 \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=-\frac {a^3 (5+2 n) (d \tan (e+f x))^{1+n}}{d f (1+n) (2+n)}+\frac {4 a^3 \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^3+i a^3 \tan (e+f x)\right )}{d f (2+n)} \] Output:
-a^3*(5+2*n)*(d*tan(f*x+e))^(1+n)/d/f/(1+n)/(2+n)+4*a^3*hypergeom([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^3+I*a^3*tan(f*x+e))/d/f/(2+n)
Time = 0.47 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.59 \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=\frac {a^3 \tan (e+f x) (d \tan (e+f x))^n (-3 (2+n)+4 (2+n) \operatorname {Hypergeometric2F1}(1,1+n,2+n,i \tan (e+f x))-i (1+n) \tan (e+f x))}{f (1+n) (2+n)} \] Input:
Integrate[(d*Tan[e + f*x])^n*(a + I*a*Tan[e + f*x])^3,x]
Output:
(a^3*Tan[e + f*x]*(d*Tan[e + f*x])^n*(-3*(2 + n) + 4*(2 + n)*Hypergeometri c2F1[1, 1 + n, 2 + n, I*Tan[e + f*x]] - I*(1 + n)*Tan[e + f*x]))/(f*(1 + n )*(2 + n))
Time = 0.66 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.02, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.346, Rules used = {3042, 4039, 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))^3 (d \tan (e+f x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+i a \tan (e+f x))^3 (d \tan (e+f x))^ndx\) |
\(\Big \downarrow \) 4039 |
\(\displaystyle \frac {a \int (d \tan (e+f x))^n (i \tan (e+f x) a+a) (a d (2 n+3)+i a d (2 n+5) \tan (e+f x))dx}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \int (d \tan (e+f x))^n (i \tan (e+f x) a+a) (a d (2 n+3)+i a d (2 n+5) \tan (e+f x))dx}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 4075 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}+\int (d \tan (e+f x))^n \left (4 d (n+2) a^2+4 i d (n+2) \tan (e+f x) a^2\right )dx\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}+\int (d \tan (e+f x))^n \left (4 d (n+2) a^2+4 i d (n+2) \tan (e+f x) a^2\right )dx\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 4020 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}+\frac {16 i a^4 d^2 (n+2)^2 \int -\frac {(d \tan (e+f x))^n}{4 a^2 d (n+2) \left (4 a^2 d (n+2)-4 i a^2 d (n+2) \tan (e+f x)\right )}d\left (4 i a^2 d (n+2) \tan (e+f x)\right )}{f}\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}-\frac {16 i a^4 d^2 (n+2)^2 \int \frac {(d \tan (e+f x))^n}{4 a^2 d (n+2) \left (4 a^2 d (n+2)-4 i a^2 d (n+2) \tan (e+f x)\right )}d\left (4 i a^2 d (n+2) \tan (e+f x)\right )}{f}\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}-\frac {i a^2 d 4^{1-n} (n+2) \int \frac {4^n (d \tan (e+f x))^n}{4 a^2 d (n+2)-4 i a^2 d (n+2) \tan (e+f x)}d\left (4 i a^2 d (n+2) \tan (e+f x)\right )}{f}\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
\(\Big \downarrow \) 74 |
\(\displaystyle \frac {a \left (-\frac {a^2 (2 n+5) (d \tan (e+f x))^{n+1}}{f (n+1)}+\frac {4 a^2 (n+2) (d \tan (e+f x))^{n+1} \operatorname {Hypergeometric2F1}(1,n+1,n+2,i \tan (e+f x))}{f (n+1)}\right )}{d (n+2)}-\frac {\left (a^3+i a^3 \tan (e+f x)\right ) (d \tan (e+f x))^{n+1}}{d f (n+2)}\) |
Input:
Int[(d*Tan[e + f*x])^n*(a + I*a*Tan[e + f*x])^3,x]
Output:
-(((d*Tan[e + f*x])^(1 + n)*(a^3 + I*a^3*Tan[e + f*x]))/(d*f*(2 + n))) + ( a*(-((a^2*(5 + 2*n)*(d*Tan[e + f*x])^(1 + n))/(f*(1 + n))) + (4*a^2*(2 + 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))
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 \left (d \tan \left (f x +e \right )\right )^{n} \left (a +i a \tan \left (f x +e \right )\right )^{3}d x\]
Input:
int((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^3,x)
Output:
int((d*tan(f*x+e))^n*(a+I*a*tan(f*x+e))^3,x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} \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))^3,x, algorithm="fricas")
Output:
integral(8*a^3*((-I*d*e^(2*I*f*x + 2*I*e) + I*d)/(e^(2*I*f*x + 2*I*e) + 1) )^n*e^(6*I*f*x + 6*I*e)/(e^(6*I*f*x + 6*I*e) + 3*e^(4*I*f*x + 4*I*e) + 3*e ^(2*I*f*x + 2*I*e) + 1), x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=- i a^{3} \left (\int i \left (d \tan {\left (e + f x \right )}\right )^{n}\, dx + \int \left (- 3 \left (d \tan {\left (e + f x \right )}\right )^{n} \tan {\left (e + f x \right )}\right )\, dx + \int \left (d \tan {\left (e + f x \right )}\right )^{n} \tan ^{3}{\left (e + f x \right )}\, dx + \int \left (- 3 i \left (d \tan {\left (e + f x \right )}\right )^{n} \tan ^{2}{\left (e + f x \right )}\right )\, dx\right ) \] Input:
integrate((d*tan(f*x+e))**n*(a+I*a*tan(f*x+e))**3,x)
Output:
-I*a**3*(Integral(I*(d*tan(e + f*x))**n, x) + Integral(-3*(d*tan(e + f*x)) **n*tan(e + f*x), x) + Integral((d*tan(e + f*x))**n*tan(e + f*x)**3, x) + Integral(-3*I*(d*tan(e + f*x))**n*tan(e + f*x)**2, x))
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} \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))^3,x, algorithm="maxima")
Output:
integrate((I*a*tan(f*x + e) + a)^3*(d*tan(f*x + e))^n, x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=\int { {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{3} \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))^3,x, algorithm="giac")
Output:
integrate((I*a*tan(f*x + e) + a)^3*(d*tan(f*x + e))^n, x)
Timed out. \[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, 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 )}^3 \,d x \] Input:
int((d*tan(e + f*x))^n*(a + a*tan(e + f*x)*1i)^3,x)
Output:
int((d*tan(e + f*x))^n*(a + a*tan(e + f*x)*1i)^3, x)
\[ \int (d \tan (e+f x))^n (a+i a \tan (e+f x))^3 \, dx=\frac {d^{n} a^{3} \left (-\tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{2} i n +4 \tan \left (f x +e \right )^{n} i n +8 \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 -4 \left (\int \frac {\tan \left (f x +e \right )^{n}}{\tan \left (f x +e \right )}d x \right ) f i \,n^{2}-8 \left (\int \frac {\tan \left (f x +e \right )^{n}}{\tan \left (f x +e \right )}d x \right ) f i n -3 \left (\int \tan \left (f x +e \right )^{n} \tan \left (f x +e \right )^{2}d x \right ) f \,n^{2}-6 \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))^3,x)
Output:
(d**n*a**3*( - tan(e + f*x)**n*tan(e + f*x)**2*i*n + 4*tan(e + f*x)**n*i*n + 8*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 - 4*int(tan(e + f*x)**n/tan(e + f*x),x)*f*i*n**2 - 8*int(tan(e + f*x)**n/tan(e + f*x),x)*f*i*n - 3*int(tan(e + f*x)**n*tan(e + f*x)**2,x )*f*n**2 - 6*int(tan(e + f*x)**n*tan(e + f*x)**2,x)*f*n))/(f*n*(n + 2))