\(\int \frac {(c (d \tan (e+f x))^p)^n}{a+i a \tan (e+f x)} \, dx\) [1337]

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

Optimal result

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

hypergeom([2, 1/2*n*p+1/2],[1/2*n*p+3/2],-tan(f*x+e)^2)*tan(f*x+e)*(c*(d*t 
an(f*x+e))^p)^n/a/f/(n*p+1)-I*hypergeom([2, 1/2*n*p+1],[1/2*n*p+2],-tan(f* 
x+e)^2)*tan(f*x+e)^2*(c*(d*tan(f*x+e))^p)^n/a/f/(n*p+2)
 

Mathematica [A] (verified)

Time = 0.36 (sec) , antiderivative size = 121, normalized size of antiderivative = 0.90 \[ \int \frac {\left (c (d \tan (e+f x))^p\right )^n}{a+i a \tan (e+f x)} \, dx=\frac {\tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n \left ((2+n p) \operatorname {Hypergeometric2F1}\left (2,\frac {1}{2} (1+n p),\frac {1}{2} (3+n p),-\tan ^2(e+f x)\right )-i (1+n p) \operatorname {Hypergeometric2F1}\left (2,1+\frac {n p}{2},2+\frac {n p}{2},-\tan ^2(e+f x)\right ) \tan (e+f x)\right )}{a f (1+n p) (2+n p)} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.38 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.01, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {3042, 4853, 27, 2003, 2042, 92, 82, 278}

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 {\left (c (d \tan (e+f x))^p\right )^n}{a+i a \tan (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (c (d \tan (e+f x))^p\right )^n}{a+i a \tan (e+f x)}dx\)

\(\Big \downarrow \) 4853

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2003

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

\(\Big \downarrow \) 2042

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

\(\Big \downarrow \) 92

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

\(\Big \downarrow \) 82

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

\(\Big \downarrow \) 278

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 82
Int[((a_) + (b_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_) 
)^(p_.), x_] :> Int[(a*c + b*d*x^2)^m*(e + f*x)^p, x] /; FreeQ[{a, b, c, d, 
 e, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m] && IntegerQ[m]
 

rule 92
Int[((f_.)*(x_))^(p_)*((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), 
x_] :> Simp[a   Int[(a + b*x)^n*(c + d*x)^n*(f*x)^p, x], x] + Simp[b/f   In 
t[(a + b*x)^n*(c + d*x)^n*(f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, f, m, 
 n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[m - n - 1, 0] &&  !RationalQ[p] && 
!IGtQ[m, 0] && NeQ[m + n + p + 2, 0]
 

rule 278
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[a^p*(( 
c*x)^(m + 1)/(c*(m + 1)))*Hypergeometric2F1[-p, (m + 1)/2, (m + 1)/2 + 1, ( 
-b)*(x^2/a)], x] /; FreeQ[{a, b, c, m, p}, x] &&  !IGtQ[p, 0] && (ILtQ[p, 0 
] || GtQ[a, 0])
 

rule 2003
Int[(u_)*((c_) + (d_.)*(x_))^(n_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] : 
> Int[u*(c + d*x)^(n + p)*(a/c + (b/d)*x)^p, x] /; FreeQ[{a, b, c, d, n, p} 
, x] && EqQ[b*c^2 + a*d^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[c, 0] && 
  !IntegerQ[n]))
 

rule 2042
Int[(u_.)*((c_.)*((d_)*((a_.) + (b_.)*(x_)))^(q_))^(p_), x_Symbol] :> Simp[ 
(c*(d*(a + b*x))^q)^p/(a + b*x)^(p*q)   Int[u*(a + b*x)^(p*q), x], x] /; Fr 
eeQ[{a, b, c, d, q, p}, x] &&  !IntegerQ[q] &&  !IntegerQ[p]
 

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

rule 4853
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, Simp[With[{d = FreeFa 
ctors[Tan[v], x]}, d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d]], x] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x, True] && TryPureTanSubst[ActivateTrig[u], x 
]]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral(1/2*(e^(2*I*f*x + 2*I*e) + 1)*e^(n*p*log((-I*d*e^(2*I*f*x + 2*I*e 
) + I*d)/(e^(2*I*f*x + 2*I*e) + 1)) - 2*I*f*x + n*log(c) - 2*I*e)/a, x)
 

Sympy [F]

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

integrate((c*(d*tan(f*x+e))**p)**n/(a+I*a*tan(f*x+e)),x)
 

Output:

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

Maxima [F(-2)]

Exception generated. \[ \int \frac {\left (c (d \tan (e+f x))^p\right )^n}{a+i a \tan (e+f x)} \, dx=\text {Exception raised: RuntimeError} \] Input:

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

Output:

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is un 
defined.
                                                                                    
                                                                                    
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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