\(\int (a \cos (e+f x))^m (b \sec (e+f x))^n \, dx\) [260]

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 = 21, antiderivative size = 88 \[ \int (a \cos (e+f x))^m (b \sec (e+f x))^n \, dx=-\frac {(a \cos (e+f x))^{1+m} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+m-n),\frac {1}{2} (3+m-n),\cos ^2(e+f x)\right ) (b \sec (e+f x))^n \sin (e+f x)}{a f (1+m-n) \sqrt {\sin ^2(e+f x)}} \] Output:

-(a*cos(f*x+e))^(1+m)*hypergeom([1/2, 1/2+1/2*m-1/2*n],[3/2+1/2*m-1/2*n],c 
os(f*x+e)^2)*(b*sec(f*x+e))^n*sin(f*x+e)/a/f/(1+m-n)/(sin(f*x+e)^2)^(1/2)
 

Mathematica [A] (verified)

Time = 12.05 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.01 \[ \int (a \cos (e+f x))^m (b \sec (e+f x))^n \, dx=-\frac {\cos (e+f x) (a \cos (e+f x))^m \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+m-n),\frac {1}{2} (3+m-n),\cos ^2(e+f x)\right ) (b \sec (e+f x))^n \sin (e+f x)}{f (1+m-n) \sqrt {\sin ^2(e+f x)}} \] Input:

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

Output:

-((Cos[e + f*x]*(a*Cos[e + f*x])^m*Hypergeometric2F1[1/2, (1 + m - n)/2, ( 
3 + m - n)/2, Cos[e + f*x]^2]*(b*Sec[e + f*x])^n*Sin[e + f*x])/(f*(1 + m - 
 n)*Sqrt[Sin[e + f*x]^2]))
 

Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3042, 3068, 3042, 3122}

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \left (a \sin \left (e+f x+\frac {\pi }{2}\right )\right )^m \left (b \csc \left (e+f x+\frac {\pi }{2}\right )\right )^ndx\)

\(\Big \downarrow \) 3068

\(\displaystyle (a \cos (e+f x))^n (b \sec (e+f x))^n \int (a \cos (e+f x))^{m-n}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle (a \cos (e+f x))^n (b \sec (e+f x))^n \int \left (a \sin \left (e+f x+\frac {\pi }{2}\right )\right )^{m-n}dx\)

\(\Big \downarrow \) 3122

\(\displaystyle -\frac {\sin (e+f x) (a \cos (e+f x))^{m+1} (b \sec (e+f x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (m-n+1),\frac {1}{2} (m-n+3),\cos ^2(e+f x)\right )}{a f (m-n+1) \sqrt {\sin ^2(e+f x)}}\)

Input:

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

Output:

-(((a*Cos[e + f*x])^(1 + m)*Hypergeometric2F1[1/2, (1 + m - n)/2, (3 + m - 
 n)/2, Cos[e + f*x]^2]*(b*Sec[e + f*x])^n*Sin[e + f*x])/(a*f*(1 + m - n)*S 
qrt[Sin[e + f*x]^2]))
 

Defintions of rubi rules used

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

rule 3068
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m 
_.), x_Symbol] :> Simp[(a*b)^IntPart[n]*(a*Sin[e + f*x])^FracPart[n]*(b*Csc 
[e + f*x])^FracPart[n]   Int[(a*Sin[e + f*x])^(m - n), x], x] /; FreeQ[{a, 
b, e, f, m, n}, x] &&  !IntegerQ[m] &&  !IntegerQ[n]
 

rule 3122
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( 
b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 
F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] 
 &&  !IntegerQ[2*n]
 
Maple [F]

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

Input:

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

Output:

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

Fricas [F]

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

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

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

Output:

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