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

Optimal result
Mathematica [C] (warning: unable to verify)
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 = 182 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^n \, dx=\frac {b \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-\sqrt {-b^2}},\frac {a+b \tan (e+f x)}{a+\sqrt {-b^2}}\right ) (d \sec (e+f x))^m (a+b \tan (e+f x))^{1+n} \left (1-\frac {a+b \tan (e+f x)}{a-\sqrt {-b^2}}\right )^{-m/2} \left (1-\frac {a+b \tan (e+f x)}{a+\sqrt {-b^2}}\right )^{-m/2}}{\left (a^2+b^2\right ) f (1+n)} \] Output:

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

Mathematica [C] (warning: unable to verify)

Result contains complex when optimal does not.

Time = 5.06 (sec) , antiderivative size = 699, normalized size of antiderivative = 3.84 \[ \int (d \sec (e+f x))^m (a+b \tan (e+f x))^n \, dx=\frac {2 \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) (d \sec (e+f x))^m (a+b \tan (e+f x))^{1+n}}{f \left (2 b \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) \sec ^2(e+f x)+2 n \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) (b-a \tan (e+f x))-\frac {b (-2+m) (1+n) \left ((a-i b) \operatorname {AppellF1}\left (2+n,1-\frac {m}{2},2-\frac {m}{2},3+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right )+(a+i b) \operatorname {AppellF1}\left (2+n,2-\frac {m}{2},1-\frac {m}{2},3+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right )\right ) \sec ^2(e+f x) (a+b \tan (e+f x))}{(a-i b) (a+i b) (2+n)}+2 (m+n) \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) \tan (e+f x) (a+b \tan (e+f x))-\frac {m \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) \sec ^2(e+f x) (a+b \tan (e+f x))}{-i+\tan (e+f x)}-\frac {m \operatorname {AppellF1}\left (1+n,1-\frac {m}{2},1-\frac {m}{2},2+n,\frac {a+b \tan (e+f x)}{a-i b},\frac {a+b \tan (e+f x)}{a+i b}\right ) \sec ^2(e+f x) (a+b \tan (e+f x))}{i+\tan (e+f x)}\right )} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 186, normalized size of antiderivative = 1.02, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3042, 3995, 150}

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 (d \sec (e+f x))^m (a+b \tan (e+f x))^n \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3995

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

\(\Big \downarrow \) 150

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 150
Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_ 
] :> Simp[c^n*e^p*((b*x)^(m + 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2 
, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p}, x] &&  !In 
tegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])
 

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

rule 3995
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( 
x_)])^(n_), x_Symbol] :> Simp[d^(2*IntPart[m/2])*(a^2 + b^2)^(IntPart[m/2] 
- 1)*((d*Sec[e + f*x])^(2*FracPart[m/2])/(f*b^(2*IntPart[m/2] - 1)*(1 - (a 
+ b*Tan[e + f*x])/(a - Rt[-b^2, 2]))^FracPart[m/2]*(1 - (a + b*Tan[e + f*x] 
)/(a + Rt[-b^2, 2]))^FracPart[m/2]))   Subst[Int[x^n*(1 - x/(a - Rt[-b^2, 2 
]))^(m/2 - 1)*(1 - x/(a + Rt[-b^2, 2]))^(m/2 - 1), x], x, a + b*Tan[e + f*x 
]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && NeQ[a^2 + b^2, 0] &&  !Integer 
Q[m] &&  !IntegerQ[n]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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