\(\int (d \tan (e+f x))^n (a+a \tan (e+f x))^m \, dx\) [411]

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 = 23, antiderivative size = 161 \[ \int (d \tan (e+f x))^n (a+a \tan (e+f x))^m \, dx=\frac {\operatorname {AppellF1}(1+n,-m,1,2+n,-\tan (e+f x),-i \tan (e+f x)) (d \tan (e+f x))^{1+n} (1+\tan (e+f x))^{-m} (a+a \tan (e+f x))^m}{2 d f (1+n)}+\frac {\operatorname {AppellF1}(1+n,-m,1,2+n,-\tan (e+f x),i \tan (e+f x)) (d \tan (e+f x))^{1+n} (1+\tan (e+f x))^{-m} (a+a \tan (e+f x))^m}{2 d f (1+n)} \] Output:

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

Mathematica [F]

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

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

Output:

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

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 159, normalized size of antiderivative = 0.99, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {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 \tan (e+f x)+a)^m (d \tan (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a \tan (e+f x)+a)^m (d \tan (e+f x))^ndx\)

\(\Big \downarrow \) 4058

\(\displaystyle \frac {\int \frac {(d \tan (e+f x))^n (\tan (e+f x) a+a)^m}{\tan ^2(e+f x)+1}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 615

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

\(\Big \downarrow \) 2009

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

Input:

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

Output:

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

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

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

Integral((a*(tan(e + f*x) + 1))**m*(d*tan(e + f*x))**n, x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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