\(\int (c (d \tan (e+f x))^p)^n (a+b \tan (e+f x))^m \, dx\) [1339]

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

Optimal result

Integrand size = 27, antiderivative size = 203 \[ \int \left (c (d \tan (e+f x))^p\right )^n (a+b \tan (e+f x))^m \, dx=\frac {\operatorname {AppellF1}\left (1+n p,-m,1,2+n p,-\frac {b \tan (e+f x)}{a},-i \tan (e+f x)\right ) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n (a+b \tan (e+f x))^m \left (\frac {a+b \tan (e+f x)}{a}\right )^{-m}}{2 f (1+n p)}+\frac {\operatorname {AppellF1}\left (1+n p,-m,1,2+n p,-\frac {b \tan (e+f x)}{a},i \tan (e+f x)\right ) \tan (e+f x) \left (c (d \tan (e+f x))^p\right )^n (a+b \tan (e+f x))^m \left (\frac {a+b \tan (e+f x)}{a}\right )^{-m}}{2 f (1+n p)} \] Output:

1/2*AppellF1(n*p+1,1,-m,n*p+2,-I*tan(f*x+e),-b*tan(f*x+e)/a)*tan(f*x+e)*(c 
*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^m/f/(n*p+1)/(((a+b*tan(f*x+e))/a)^m) 
+1/2*AppellF1(n*p+1,1,-m,n*p+2,I*tan(f*x+e),-b*tan(f*x+e)/a)*tan(f*x+e)*(c 
*(d*tan(f*x+e))^p)^n*(a+b*tan(f*x+e))^m/f/(n*p+1)/(((a+b*tan(f*x+e))/a)^m)
 

Mathematica [F]

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

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

Output:

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

Rubi [A] (verified)

Time = 0.52 (sec) , antiderivative size = 220, normalized size of antiderivative = 1.08, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3042, 4061, 3042, 4058, 615, 2009}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int (a+b \tan (e+f x))^m \left (c (d \tan (e+f x))^p\right )^ndx\)

\(\Big \downarrow \) 4061

\(\displaystyle (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n \int (d \tan (e+f x))^{n p} (a+b \tan (e+f x))^mdx\)

\(\Big \downarrow \) 3042

\(\displaystyle (d \tan (e+f x))^{-n p} \left (c (d \tan (e+f x))^p\right )^n \int (d \tan (e+f x))^{n p} (a+b \tan (e+f x))^mdx\)

\(\Big \downarrow \) 4058

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

\(\Big \downarrow \) 615

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

Defintions of rubi rules used

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

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4058
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, S 
imp[ff/f   Subst[Int[(a + b*ff*x)^m*((c + d*ff*x)^n/(1 + ff^2*x^2)), x], x, 
 Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && NeQ[b*c - a 
*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]
 

rule 4061
Int[((c_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(p_))^(n_)*((a_.) + (b_.)*tan[(e 
_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Simp[c^IntPart[n]*((c*(d*Tan[e + f*x 
])^p)^FracPart[n]/(d*Tan[e + f*x])^(p*FracPart[n]))   Int[(a + b*Tan[e + f* 
x])^m*(d*Tan[e + f*x])^(n*p), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, 
x] &&  !IntegerQ[n] &&  !IntegerQ[m]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

integral(((d*tan(f*x + e))^p*c)^n*(b*tan(f*x + e) + a)^m, x)
 

Sympy [F]

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

integrate((c*(d*tan(f*x+e))**p)**n*(a+b*tan(f*x+e))**m,x)
 

Output:

Integral((c*(d*tan(e + f*x))**p)**n*(a + b*tan(e + f*x))**m, x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

d**(n*p)*c**n*int(tan(e + f*x)**(n*p)*(tan(e + f*x)*b + a)**m,x)