\(\int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^2 \, dx\) [152]

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 = 32, antiderivative size = 92 \[ \int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^2 \, dx=\frac {2^{\frac {1}{2}+m} a \operatorname {Hypergeometric2F1}\left (\frac {5}{2},\frac {1}{2}-m,\frac {7}{2},\frac {1}{2} (1-\sec (e+f x))\right ) (1+\sec (e+f x))^{\frac {1}{2}-m} (a+a \sec (e+f x))^{-1+m} (c-c \sec (e+f x))^2 \tan (e+f x)}{5 f} \] Output:

1/5*2^(1/2+m)*a*hypergeom([5/2, 1/2-m],[7/2],1/2-1/2*sec(f*x+e))*(1+sec(f* 
x+e))^(1/2-m)*(a+a*sec(f*x+e))^(-1+m)*(c-c*sec(f*x+e))^2*tan(f*x+e)/f
 

Mathematica [A] (verified)

Time = 0.14 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.97 \[ \int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^2 \, dx=\frac {2^{\frac {1}{2}+m} c^2 \operatorname {Hypergeometric2F1}\left (\frac {5}{2},\frac {1}{2}-m,\frac {7}{2},\frac {1}{2} (1-\sec (e+f x))\right ) (-1+\sec (e+f x))^2 (1+\sec (e+f x))^{-\frac {1}{2}-m} (a (1+\sec (e+f x)))^m \tan (e+f x)}{5 f} \] Input:

Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])^m*(c - c*Sec[e + f*x])^2,x]
 

Output:

(2^(1/2 + m)*c^2*Hypergeometric2F1[5/2, 1/2 - m, 7/2, (1 - Sec[e + f*x])/2 
]*(-1 + Sec[e + f*x])^2*(1 + Sec[e + f*x])^(-1/2 - m)*(a*(1 + Sec[e + f*x] 
))^m*Tan[e + f*x])/(5*f)
 

Rubi [A] (verified)

Time = 0.32 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3042, 4449, 80, 79}

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 \sec (e+f x) (c-c \sec (e+f x))^2 (a \sec (e+f x)+a)^m \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (c-c \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2 \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^mdx\)

\(\Big \downarrow \) 4449

\(\displaystyle -\frac {a c \tan (e+f x) \int (\sec (e+f x) a+a)^{m-\frac {1}{2}} (c-c \sec (e+f x))^{3/2}d\sec (e+f x)}{f \sqrt {a \sec (e+f x)+a} \sqrt {c-c \sec (e+f x)}}\)

\(\Big \downarrow \) 80

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

\(\Big \downarrow \) 79

\(\displaystyle \frac {a 2^{m+\frac {1}{2}} \tan (e+f x) (c-c \sec (e+f x))^2 (\sec (e+f x)+1)^{\frac {1}{2}-m} (a \sec (e+f x)+a)^{m-1} \operatorname {Hypergeometric2F1}\left (\frac {5}{2},\frac {1}{2}-m,\frac {7}{2},\frac {1}{2} (1-\sec (e+f x))\right )}{5 f}\)

Input:

Int[Sec[e + f*x]*(a + a*Sec[e + f*x])^m*(c - c*Sec[e + f*x])^2,x]
 

Output:

(2^(1/2 + m)*a*Hypergeometric2F1[5/2, 1/2 - m, 7/2, (1 - Sec[e + f*x])/2]* 
(1 + Sec[e + f*x])^(1/2 - m)*(a + a*Sec[e + f*x])^(-1 + m)*(c - c*Sec[e + 
f*x])^2*Tan[e + f*x])/(5*f)
 

Defintions of rubi rules used

rule 79
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(( 
a + b*x)^(m + 1)/(b*(m + 1)*(b/(b*c - a*d))^n))*Hypergeometric2F1[-n, m + 1 
, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m, n}, x] 
&&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[b/(b*c - a*d), 0] && (RationalQ[m] 
 ||  !(RationalQ[n] && GtQ[-d/(b*c - a*d), 0]))
 

rule 80
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(c 
 + d*x)^FracPart[n]/((b/(b*c - a*d))^IntPart[n]*(b*((c + d*x)/(b*c - a*d))) 
^FracPart[n])   Int[(a + b*x)^m*Simp[b*(c/(b*c - a*d)) + b*d*(x/(b*c - a*d) 
), x]^n, x], x] /; FreeQ[{a, b, c, d, m, n}, x] &&  !IntegerQ[m] &&  !Integ 
erQ[n] && (RationalQ[m] ||  !SimplerQ[n + 1, m + 1])
 

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

rule 4449
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(c 
sc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_), x_Symbol] :> Simp[a*c*(Cot[e + f 
*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[c + d*Csc[e + f*x]]))   Subst[Int[(a + 
 b*x)^(m - 1/2)*(c + d*x)^(n - 1/2), x], x, Csc[e + f*x]], x] /; FreeQ[{a, 
b, c, d, e, f, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0]
 
Maple [F]

\[\int \sec \left (f x +e \right ) \left (a +a \sec \left (f x +e \right )\right )^{m} \left (c -c \sec \left (f x +e \right )\right )^{2}d x\]

Input:

int(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x)
 

Output:

int(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x)
 

Fricas [F]

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

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x, algorithm="f 
ricas")
 

Output:

integral((c^2*sec(f*x + e)^3 - 2*c^2*sec(f*x + e)^2 + c^2*sec(f*x + e))*(a 
*sec(f*x + e) + a)^m, x)
 

Sympy [F]

\[ \int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^2 \, dx=c^{2} \left (\int \left (a \sec {\left (e + f x \right )} + a\right )^{m} \sec {\left (e + f x \right )}\, dx + \int \left (- 2 \left (a \sec {\left (e + f x \right )} + a\right )^{m} \sec ^{2}{\left (e + f x \right )}\right )\, dx + \int \left (a \sec {\left (e + f x \right )} + a\right )^{m} \sec ^{3}{\left (e + f x \right )}\, dx\right ) \] Input:

integrate(sec(f*x+e)*(a+a*sec(f*x+e))**m*(c-c*sec(f*x+e))**2,x)
 

Output:

c**2*(Integral((a*sec(e + f*x) + a)**m*sec(e + f*x), x) + Integral(-2*(a*s 
ec(e + f*x) + a)**m*sec(e + f*x)**2, x) + Integral((a*sec(e + f*x) + a)**m 
*sec(e + f*x)**3, x))
 

Maxima [F]

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

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x, algorithm="m 
axima")
 

Output:

integrate((c*sec(f*x + e) - c)^2*(a*sec(f*x + e) + a)^m*sec(f*x + e), x)
 

Giac [F]

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

integrate(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x, algorithm="g 
iac")
 

Output:

integrate((c*sec(f*x + e) - c)^2*(a*sec(f*x + e) + a)^m*sec(f*x + e), x)
 

Mupad [F(-1)]

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

int(((a + a/cos(e + f*x))^m*(c - c/cos(e + f*x))^2)/cos(e + f*x),x)
 

Output:

int(((a + a/cos(e + f*x))^m*(c - c/cos(e + f*x))^2)/cos(e + f*x), x)
 

Reduce [F]

\[ \int \sec (e+f x) (a+a \sec (e+f x))^m (c-c \sec (e+f x))^2 \, dx=c^{2} \left (\int \left (\sec \left (f x +e \right ) a +a \right )^{m} \sec \left (f x +e \right )^{3}d x -2 \left (\int \left (\sec \left (f x +e \right ) a +a \right )^{m} \sec \left (f x +e \right )^{2}d x \right )+\int \left (\sec \left (f x +e \right ) a +a \right )^{m} \sec \left (f x +e \right )d x \right ) \] Input:

int(sec(f*x+e)*(a+a*sec(f*x+e))^m*(c-c*sec(f*x+e))^2,x)
 

Output:

c**2*(int((sec(e + f*x)*a + a)**m*sec(e + f*x)**3,x) - 2*int((sec(e + f*x) 
*a + a)**m*sec(e + f*x)**2,x) + int((sec(e + f*x)*a + a)**m*sec(e + f*x),x 
))