\(\int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx\) [1180]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [F]
Sympy [F]
Maxima [F]
Giac [F]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 28, antiderivative size = 192 \[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=-\frac {2 d \left (d^2+i c d m-c^2 (3+m)\right ) (a+i a \tan (e+f x))^m}{f m (2+m)}+\frac {(i c+d)^3 \operatorname {Hypergeometric2F1}\left (1,m,1+m,\frac {1}{2} (1+i \tan (e+f x))\right ) (a+i a \tan (e+f x))^m}{2 f m}-\frac {d^2 (d m+i c (4+m)) (a+i a \tan (e+f x))^{1+m}}{a f (1+m) (2+m)}+\frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (2+m)} \] Output:

-2*d*(d^2+I*c*d*m-c^2*(3+m))*(a+I*a*tan(f*x+e))^m/f/m/(2+m)+1/2*(I*c+d)^3* 
hypergeom([1, m],[1+m],1/2+1/2*I*tan(f*x+e))*(a+I*a*tan(f*x+e))^m/f/m-d^2* 
(d*m+I*c*(4+m))*(a+I*a*tan(f*x+e))^(1+m)/a/f/(1+m)/(2+m)+d*(a+I*a*tan(f*x+ 
e))^m*(c+d*tan(f*x+e))^2/f/(2+m)
 

Mathematica [A] (verified)

Time = 1.41 (sec) , antiderivative size = 146, normalized size of antiderivative = 0.76 \[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\frac {(a+i a \tan (e+f x))^m \left (-4 d (1+m) \left (d^2+i c d m-c^2 (3+m)\right )+(i c+d)^3 (1+m) (2+m) \operatorname {Hypergeometric2F1}\left (1,m,1+m,\frac {1}{2} (1+i \tan (e+f x))\right )+2 d^2 m (-i d m+c (4+m)) (-i+\tan (e+f x))+2 d m (1+m) (c+d \tan (e+f x))^2\right )}{2 f m (1+m) (2+m)} \] Input:

Integrate[(a + I*a*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^3,x]
 

Output:

((a + I*a*Tan[e + f*x])^m*(-4*d*(1 + m)*(d^2 + I*c*d*m - c^2*(3 + m)) + (I 
*c + d)^3*(1 + m)*(2 + m)*Hypergeometric2F1[1, m, 1 + m, (1 + I*Tan[e + f* 
x])/2] + 2*d^2*m*((-I)*d*m + c*(4 + m))*(-I + Tan[e + f*x]) + 2*d*m*(1 + m 
)*(c + d*Tan[e + f*x])^2))/(2*f*m*(1 + m)*(2 + m))
 

Rubi [A] (verified)

Time = 0.97 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.04, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.393, Rules used = {3042, 4043, 25, 25, 3042, 4075, 3042, 4010, 3042, 3962, 78}

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))^m (c+d \tan (e+f x))^3 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3dx\)

\(\Big \downarrow \) 4043

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\int -(i \tan (e+f x) a+a)^m (c+d \tan (e+f x)) \left (a \left (c^2 (m+2)-d (2 d+i c m)\right )-a d (i d m-c (m+4)) \tan (e+f x)\right )dx}{a (m+2)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int -(i \tan (e+f x) a+a)^m (c+d \tan (e+f x)) \left (a \left (-\left ((m+2) c^2\right )+i d m c+2 d^2\right )+a d (i d m-c (m+4)) \tan (e+f x)\right )dx}{a (m+2)}+\frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\int (i \tan (e+f x) a+a)^m (c+d \tan (e+f x)) \left (a \left (-\left ((m+2) c^2\right )+i d m c+2 d^2\right )+a d (i d m-c (m+4)) \tan (e+f x)\right )dx}{a (m+2)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\int (i \tan (e+f x) a+a)^m (c+d \tan (e+f x)) \left (a \left (-\left ((m+2) c^2\right )+i d m c+2 d^2\right )+a d (i d m-c (m+4)) \tan (e+f x)\right )dx}{a (m+2)}\)

\(\Big \downarrow \) 4075

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\int (i \tan (e+f x) a+a)^m \left (a \left (c \left (-\left ((m+2) c^2\right )+i d m c+2 d^2\right )-d^2 (i d m-c (m+4))\right )+2 a d \left (-\left ((m+3) c^2\right )+i d m c+d^2\right ) \tan (e+f x)\right )dx+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}}{a (m+2)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\int (i \tan (e+f x) a+a)^m \left (a \left (c \left (-\left ((m+2) c^2\right )+i d m c+2 d^2\right )-d^2 (i d m-c (m+4))\right )+2 a d \left (-\left ((m+3) c^2\right )+i d m c+d^2\right ) \tan (e+f x)\right )dx+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}}{a (m+2)}\)

\(\Big \downarrow \) 4010

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {-a (m+2) (c-i d)^3 \int (i \tan (e+f x) a+a)^mdx+\frac {2 a d \left (-\left (c^2 (m+3)\right )+i c d m+d^2\right ) (a+i a \tan (e+f x))^m}{f m}+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}}{a (m+2)}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {-a (m+2) (c-i d)^3 \int (i \tan (e+f x) a+a)^mdx+\frac {2 a d \left (-\left (c^2 (m+3)\right )+i c d m+d^2\right ) (a+i a \tan (e+f x))^m}{f m}+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}}{a (m+2)}\)

\(\Big \downarrow \) 3962

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\frac {i a^2 (m+2) (c-i d)^3 \int \frac {(i \tan (e+f x) a+a)^{m-1}}{a-i a \tan (e+f x)}d(i a \tan (e+f x))}{f}+\frac {2 a d \left (-\left (c^2 (m+3)\right )+i c d m+d^2\right ) (a+i a \tan (e+f x))^m}{f m}+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}}{a (m+2)}\)

\(\Big \downarrow \) 78

\(\displaystyle \frac {d (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^2}{f (m+2)}-\frac {\frac {2 a d \left (-\left (c^2 (m+3)\right )+i c d m+d^2\right ) (a+i a \tan (e+f x))^m}{f m}+\frac {d^2 (d m+i c (m+4)) (a+i a \tan (e+f x))^{m+1}}{f (m+1)}+\frac {i a (m+2) (c-i d)^3 (a+i a \tan (e+f x))^m \operatorname {Hypergeometric2F1}\left (1,m,m+1,\frac {i \tan (e+f x) a+a}{2 a}\right )}{2 f m}}{a (m+2)}\)

Input:

Int[(a + I*a*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^3,x]
 

Output:

(d*(a + I*a*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^2)/(f*(2 + m)) - ((2*a*d* 
(d^2 + I*c*d*m - c^2*(3 + m))*(a + I*a*Tan[e + f*x])^m)/(f*m) + ((I/2)*a*( 
c - I*d)^3*(2 + m)*Hypergeometric2F1[1, m, 1 + m, (a + I*a*Tan[e + f*x])/( 
2*a)]*(a + I*a*Tan[e + f*x])^m)/(f*m) + (d^2*(d*m + I*c*(4 + m))*(a + I*a* 
Tan[e + f*x])^(1 + m))/(f*(1 + m)))/(a*(2 + m))
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 78
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]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3962
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]
 

rule 4010
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
(f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Simp 
[(b*c + a*d)/b   Int[(a + b*Tan[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e 
, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] &&  !LtQ[m, 0]
 

rule 4043
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> Simp[d*(a + b*Tan[e + f*x])^m*((c + d*Tan[e 
 + f*x])^(n - 1)/(f*(m + n - 1))), x] - Simp[1/(a*(m + n - 1))   Int[(a + b 
*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n - 2)*Simp[d*(b*c*m + a*d*(-1 + n)) 
 - a*c^2*(m + n - 1) + d*(b*d*m - a*c*(m + 2*n - 2))*Tan[e + f*x], x], x], 
x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2 
, 0] && NeQ[c^2 + d^2, 0] && GtQ[n, 1] && NeQ[m + n - 1, 0] && (IntegerQ[n] 
 || IntegersQ[2*m, 2*n])
 

rule 4075
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]
 
Maple [F]

\[\int \left (a +i a \tan \left (f x +e \right )\right )^{m} \left (c +d \tan \left (f x +e \right )\right )^{3}d x\]

Input:

int((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x)
 

Output:

int((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x)
 

Fricas [F]

\[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\int { {\left (d \tan \left (f x + e\right ) + c\right )}^{3} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{m} \,d x } \] Input:

integrate((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x, algorithm="fricas")
 

Output:

integral((c^3 + 3*I*c^2*d - 3*c*d^2 - I*d^3 + (c^3 - 3*I*c^2*d - 3*c*d^2 + 
 I*d^3)*e^(6*I*f*x + 6*I*e) + 3*(c^3 - I*c^2*d + c*d^2 - I*d^3)*e^(4*I*f*x 
 + 4*I*e) + 3*(c^3 + I*c^2*d + c*d^2 + I*d^3)*e^(2*I*f*x + 2*I*e))*(2*a*e^ 
(2*I*f*x + 2*I*e)/(e^(2*I*f*x + 2*I*e) + 1))^m/(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)
 

Sympy [F]

\[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\int \left (i a \left (\tan {\left (e + f x \right )} - i\right )\right )^{m} \left (c + d \tan {\left (e + f x \right )}\right )^{3}\, dx \] Input:

integrate((a+I*a*tan(f*x+e))**m*(c+d*tan(f*x+e))**3,x)
 

Output:

Integral((I*a*(tan(e + f*x) - I))**m*(c + d*tan(e + f*x))**3, x)
 

Maxima [F]

\[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\int { {\left (d \tan \left (f x + e\right ) + c\right )}^{3} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{m} \,d x } \] Input:

integrate((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x, algorithm="maxima")
 

Output:

integrate((d*tan(f*x + e) + c)^3*(I*a*tan(f*x + e) + a)^m, x)
 

Giac [F]

\[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\int { {\left (d \tan \left (f x + e\right ) + c\right )}^{3} {\left (i \, a \tan \left (f x + e\right ) + a\right )}^{m} \,d x } \] Input:

integrate((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x, algorithm="giac")
 

Output:

integrate((d*tan(f*x + e) + c)^3*(I*a*tan(f*x + e) + a)^m, x)
 

Mupad [F(-1)]

Timed out. \[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\int {\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^m\,{\left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )}^3 \,d x \] Input:

int((a + a*tan(e + f*x)*1i)^m*(c + d*tan(e + f*x))^3,x)
 

Output:

int((a + a*tan(e + f*x)*1i)^m*(c + d*tan(e + f*x))^3, x)
 

Reduce [F]

\[ \int (a+i a \tan (e+f x))^m (c+d \tan (e+f x))^3 \, dx=\frac {-\left (\tan \left (f x +e \right ) a i +a \right )^{m} c^{3} i +\left (\int \left (\tan \left (f x +e \right ) a i +a \right )^{m} \tan \left (f x +e \right )^{3}d x \right ) d^{3} f m +3 \left (\int \left (\tan \left (f x +e \right ) a i +a \right )^{m} \tan \left (f x +e \right )^{2}d x \right ) c \,d^{2} f m +\left (\int \left (\tan \left (f x +e \right ) a i +a \right )^{m} \tan \left (f x +e \right )d x \right ) c^{3} f i m +3 \left (\int \left (\tan \left (f x +e \right ) a i +a \right )^{m} \tan \left (f x +e \right )d x \right ) c^{2} d f m}{f m} \] Input:

int((a+I*a*tan(f*x+e))^m*(c+d*tan(f*x+e))^3,x)
 

Output:

( - (tan(e + f*x)*a*i + a)**m*c**3*i + int((tan(e + f*x)*a*i + a)**m*tan(e 
 + f*x)**3,x)*d**3*f*m + 3*int((tan(e + f*x)*a*i + a)**m*tan(e + f*x)**2,x 
)*c*d**2*f*m + int((tan(e + f*x)*a*i + a)**m*tan(e + f*x),x)*c**3*f*i*m + 
3*int((tan(e + f*x)*a*i + a)**m*tan(e + f*x),x)*c**2*d*f*m)/(f*m)