\(\int \frac {(a+i a \tan (e+f x))^m}{(c+d \tan (e+f x))^2} \, dx\) [1184]

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 = 180 \[ \int \frac {(a+i a \tan (e+f x))^m}{(c+d \tan (e+f x))^2} \, dx=-\frac {i \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 (c-i d)^2 f m}-\frac {d (c (2-m)+i d m) \operatorname {Hypergeometric2F1}\left (1,m,1+m,-\frac {d (1+i \tan (e+f x))}{i c-d}\right ) (a+i a \tan (e+f x))^m}{\left (c^2+d^2\right )^2 f m}-\frac {d (a+i a \tan (e+f x))^m}{\left (c^2+d^2\right ) f (c+d \tan (e+f x))} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.96 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.21, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.321, Rules used = {3042, 4044, 3042, 4083, 3042, 3962, 78, 4082, 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 \frac {(a+i a \tan (e+f x))^m}{(c+d \tan (e+f x))^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4044

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4083

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3962

\(\displaystyle \frac {\frac {d (c (2-m)+i d m) \int \frac {(a-i a \tan (e+f x)) (i \tan (e+f x) a+a)^m}{c+d \tan (e+f x)}dx}{d+i c}-\frac {i a^2 (c+i d) \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 (c-i d)}}{a \left (c^2+d^2\right )}-\frac {d (a+i a \tan (e+f x))^m}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}\)

\(\Big \downarrow \) 78

\(\displaystyle \frac {\frac {d (c (2-m)+i d m) \int \frac {(a-i a \tan (e+f x)) (i \tan (e+f x) a+a)^m}{c+d \tan (e+f x)}dx}{d+i c}-\frac {i a (c+i d) (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 (c-i d)}}{a \left (c^2+d^2\right )}-\frac {d (a+i a \tan (e+f x))^m}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}\)

\(\Big \downarrow \) 4082

\(\displaystyle \frac {\frac {a^2 d (c (2-m)+i d m) \int \frac {(i \tan (e+f x) a+a)^{m-1}}{c+d \tan (e+f x)}d\tan (e+f x)}{f (d+i c)}-\frac {i a (c+i d) (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 (c-i d)}}{a \left (c^2+d^2\right )}-\frac {d (a+i a \tan (e+f x))^m}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}\)

\(\Big \downarrow \) 78

\(\displaystyle \frac {\frac {a d (c (2-m)+i d m) (a+i a \tan (e+f x))^m \operatorname {Hypergeometric2F1}\left (1,m,m+1,-\frac {d (i \tan (e+f x)+1)}{i c-d}\right )}{f m (-d+i c) (d+i c)}-\frac {i a (c+i d) (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 (c-i d)}}{a \left (c^2+d^2\right )}-\frac {d (a+i a \tan (e+f x))^m}{f \left (c^2+d^2\right ) (c+d \tan (e+f x))}\)

Input:

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

Output:

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

Defintions of rubi rules used

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 4044
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*(n + 1)*(c^2 + d^2))), x] - Simp[1/(a*(c^2 + d^2)*(n + 
1))   Int[(a + b*Tan[e + f*x])^m*(c + d*Tan[e + f*x])^(n + 1)*Simp[b*d*m - 
a*c*(n + 1) + a*d*(m + n + 1)*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] && LtQ[n, -1] && (IntegerQ[n] || IntegersQ[2*m, 2*n])
 

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

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

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral((2*a*e^(2*I*f*x + 2*I*e)/(e^(2*I*f*x + 2*I*e) + 1))^m*(e^(4*I*f*x 
 + 4*I*e) + 2*e^(2*I*f*x + 2*I*e) + 1)/(c^2 + 2*I*c*d - d^2 + (c^2 - 2*I*c 
*d - d^2)*e^(4*I*f*x + 4*I*e) + 2*(c^2 + d^2)*e^(2*I*f*x + 2*I*e)), x)
 

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

Timed out. \[ \int \frac {(a+i a \tan (e+f x))^m}{(c+d \tan (e+f x))^2} \, dx=\int \frac {{\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 )}^2} \,d x \] Input:

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

Output:

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

Reduce [F]

\[ \int \frac {(a+i a \tan (e+f x))^m}{(c+d \tan (e+f x))^2} \, dx=\text {too large to display} \] Input:

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

Output:

( - int((tan(e + f*x)*a*i + a)**m/(tan(e + f*x)**2*c**7*d**2*i*m**6 + 9*ta 
n(e + f*x)**2*c**7*d**2*i*m**5 + 32*tan(e + f*x)**2*c**7*d**2*i*m**4 + 56* 
tan(e + f*x)**2*c**7*d**2*i*m**3 + 48*tan(e + f*x)**2*c**7*d**2*i*m**2 + 1 
6*tan(e + f*x)**2*c**7*d**2*i*m - 6*tan(e + f*x)**2*c**6*d**3*m**6 - 46*ta 
n(e + f*x)**2*c**6*d**3*m**5 - 137*tan(e + f*x)**2*c**6*d**3*m**4 - 200*ta 
n(e + f*x)**2*c**6*d**3*m**3 - 152*tan(e + f*x)**2*c**6*d**3*m**2 - 64*tan 
(e + f*x)**2*c**6*d**3*m - 16*tan(e + f*x)**2*c**6*d**3 - 15*tan(e + f*x)* 
*2*c**5*d**4*i*m**6 - 96*tan(e + f*x)**2*c**5*d**4*i*m**5 - 237*tan(e + f* 
x)**2*c**5*d**4*i*m**4 - 296*tan(e + f*x)**2*c**5*d**4*i*m**3 - 216*tan(e 
+ f*x)**2*c**5*d**4*i*m**2 - 96*tan(e + f*x)**2*c**5*d**4*i*m - 16*tan(e + 
 f*x)**2*c**5*d**4*i + 20*tan(e + f*x)**2*c**4*d**5*m**6 + 105*tan(e + f*x 
)**2*c**4*d**5*m**5 + 218*tan(e + f*x)**2*c**4*d**5*m**4 + 248*tan(e + f*x 
)**2*c**4*d**5*m**3 + 168*tan(e + f*x)**2*c**4*d**5*m**2 + 48*tan(e + f*x) 
**2*c**4*d**5*m + 15*tan(e + f*x)**2*c**3*d**6*i*m**6 + 65*tan(e + f*x)**2 
*c**3*d**6*i*m**5 + 122*tan(e + f*x)**2*c**3*d**6*i*m**4 + 128*tan(e + f*x 
)**2*c**3*d**6*i*m**3 + 56*tan(e + f*x)**2*c**3*d**6*i*m**2 - 6*tan(e + f* 
x)**2*c**2*d**7*m**6 - 24*tan(e + f*x)**2*c**2*d**7*m**5 - 45*tan(e + f*x) 
**2*c**2*d**7*m**4 - 32*tan(e + f*x)**2*c**2*d**7*m**3 - tan(e + f*x)**2*c 
*d**8*i*m**6 - 6*tan(e + f*x)**2*c*d**8*i*m**5 - 9*tan(e + f*x)**2*c*d**8* 
i*m**4 + tan(e + f*x)**2*d**9*m**5 + 2*tan(e + f*x)*c**8*d*i*m**6 + 18*...