Integrand size = 21, antiderivative size = 230 \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\frac {a^3 (5+2 n) \sec ^{1+n}(e+f x) \sin (e+f x)}{f (1+n) (2+n)}+\frac {\sec ^{1+n}(e+f x) \left (a^3+a^3 \sec (e+f x)\right ) \sin (e+f x)}{f (2+n)}-\frac {a^3 (1+4 n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(e+f x)\right ) \sec ^{-1+n}(e+f x) \sin (e+f x)}{f \left (1-n^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {a^3 (7+4 n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n}{2},\frac {2-n}{2},\cos ^2(e+f x)\right ) \sec ^n(e+f x) \sin (e+f x)}{f n (2+n) \sqrt {\sin ^2(e+f x)}} \] Output:
a^3*(5+2*n)*sec(f*x+e)^(1+n)*sin(f*x+e)/f/(1+n)/(2+n)+sec(f*x+e)^(1+n)*(a^ 3+a^3*sec(f*x+e))*sin(f*x+e)/f/(2+n)-a^3*(1+4*n)*hypergeom([1/2, 1/2-1/2*n ],[3/2-1/2*n],cos(f*x+e)^2)*sec(f*x+e)^(-1+n)*sin(f*x+e)/f/(-n^2+1)/(sin(f *x+e)^2)^(1/2)+a^3*(7+4*n)*hypergeom([1/2, -1/2*n],[1-1/2*n],cos(f*x+e)^2) *sec(f*x+e)^n*sin(f*x+e)/f/n/(2+n)/(sin(f*x+e)^2)^(1/2)
Time = 0.98 (sec) , antiderivative size = 165, normalized size of antiderivative = 0.72 \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\frac {a^3 \csc (e+f x) \sec ^{-1+n}(e+f x) \left (n (3 (2+n)+(1+n) \sec (e+f x)) \tan ^2(e+f x)+\left (2+9 n+4 n^2\right ) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {2+n}{2},\sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}+n (7+4 n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\sec ^2(e+f x)\right ) \sec (e+f x) \sqrt {-\tan ^2(e+f x)}\right )}{f n (1+n) (2+n)} \] Input:
Integrate[Sec[e + f*x]^n*(a + a*Sec[e + f*x])^3,x]
Output:
(a^3*Csc[e + f*x]*Sec[e + f*x]^(-1 + n)*(n*(3*(2 + n) + (1 + n)*Sec[e + f* x])*Tan[e + f*x]^2 + (2 + 9*n + 4*n^2)*Hypergeometric2F1[1/2, n/2, (2 + n) /2, Sec[e + f*x]^2]*Sqrt[-Tan[e + f*x]^2] + n*(7 + 4*n)*Hypergeometric2F1[ 1/2, (1 + n)/2, (3 + n)/2, Sec[e + f*x]^2]*Sec[e + f*x]*Sqrt[-Tan[e + f*x] ^2]))/(f*n*(1 + n)*(2 + n))
Time = 0.91 (sec) , antiderivative size = 239, normalized size of antiderivative = 1.04, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.476, Rules used = {3042, 4301, 3042, 4485, 3042, 4274, 3042, 4259, 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 \sec (e+f x)+a)^3 \sec ^n(e+f x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^3 \csc \left (e+f x+\frac {\pi }{2}\right )^ndx\) |
\(\Big \downarrow \) 4301 |
\(\displaystyle \frac {a \int \sec ^n(e+f x) (\sec (e+f x) a+a) (2 a (n+1)+a (2 n+5) \sec (e+f x))dx}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \int \csc \left (e+f x+\frac {\pi }{2}\right )^n \left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right ) \left (2 a (n+1)+a (2 n+5) \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 4485 |
\(\displaystyle \frac {a \left (\frac {\int \sec ^n(e+f x) \left ((n+2) (4 n+1) a^2+(n+1) (4 n+7) \sec (e+f x) a^2\right )dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {\int \csc \left (e+f x+\frac {\pi }{2}\right )^n \left ((n+2) (4 n+1) a^2+(n+1) (4 n+7) \csc \left (e+f x+\frac {\pi }{2}\right ) a^2\right )dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {a \left (\frac {a^2 (n+1) (4 n+7) \int \sec ^{n+1}(e+f x)dx+a^2 (n+2) (4 n+1) \int \sec ^n(e+f x)dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {a^2 (n+2) (4 n+1) \int \csc \left (e+f x+\frac {\pi }{2}\right )^ndx+a^2 (n+1) (4 n+7) \int \csc \left (e+f x+\frac {\pi }{2}\right )^{n+1}dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle \frac {a \left (\frac {a^2 (n+1) (4 n+7) \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{-n-1}(e+f x)dx+a^2 (n+2) (4 n+1) \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{-n}(e+f x)dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {a^2 (n+1) (4 n+7) \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{-n-1}dx+a^2 (n+2) (4 n+1) \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{-n}dx}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}+\frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {\sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}+\frac {a \left (\frac {\frac {a^2 (n+1) (4 n+7) \sin (e+f x) \sec ^n(e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n}{2},\frac {2-n}{2},\cos ^2(e+f x)\right )}{f n \sqrt {\sin ^2(e+f x)}}-\frac {a^2 (n+2) (4 n+1) \sin (e+f x) \sec ^{n-1}(e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1-n}{2},\frac {3-n}{2},\cos ^2(e+f x)\right )}{f (1-n) \sqrt {\sin ^2(e+f x)}}}{n+1}+\frac {a^2 (2 n+5) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}\right )}{n+2}\) |
Input:
Int[Sec[e + f*x]^n*(a + a*Sec[e + f*x])^3,x]
Output:
(Sec[e + f*x]^(1 + n)*(a^3 + a^3*Sec[e + f*x])*Sin[e + f*x])/(f*(2 + n)) + (a*((a^2*(5 + 2*n)*Sec[e + f*x]^(1 + n)*Sin[e + f*x])/(f*(1 + n)) + (-((a ^2*(2 + n)*(1 + 4*n)*Hypergeometric2F1[1/2, (1 - n)/2, (3 - n)/2, Cos[e + f*x]^2]*Sec[e + f*x]^(-1 + n)*Sin[e + f*x])/(f*(1 - n)*Sqrt[Sin[e + f*x]^2 ])) + (a^2*(1 + n)*(7 + 4*n)*Hypergeometric2F1[1/2, -1/2*n, (2 - n)/2, Cos [e + f*x]^2]*Sec[e + f*x]^n*Sin[e + f*x])/(f*n*Sqrt[Sin[e + f*x]^2]))/(1 + n)))/(2 + n)
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]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x] )^(n - 1)*((Sin[c + d*x]/b)^(n - 1) Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] && !IntegerQ[n]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[a Int[(d*Csc[e + f*x])^n, x], x] + Simp[b/d In t[(d*Csc[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, n}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_), x_Symbol] :> Simp[(-b^2)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 2)*((d*Csc[e + f*x])^n/(f*(m + n - 1))), x] + Simp[b/(m + n - 1) Int[(a + b*Csc[e + f*x])^(m - 2)*(d*Csc[e + f*x])^n*(b*(m + 2*n - 1) + a*(3*m + 2*n - 4)*Csc[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, n}, x] && EqQ[a^2 - b^ 2, 0] && GtQ[m, 1] && NeQ[m + n - 1, 0] && IntegerQ[2*m]
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-b)*B*Cot[ e + f*x]*((d*Csc[e + f*x])^n/(f*(n + 1))), x] + Simp[1/(n + 1) Int[(d*Csc [e + f*x])^n*Simp[A*a*(n + 1) + B*b*n + (A*b + B*a)*(n + 1)*Csc[e + f*x], x ], x], x] /; FreeQ[{a, b, d, e, f, A, B}, x] && NeQ[A*b - a*B, 0] && !LeQ[ n, -1]
\[\int \sec \left (f x +e \right )^{n} \left (a +a \sec \left (f x +e \right )\right )^{3}d x\]
Input:
int(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x)
Output:
int(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{3} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x, algorithm="fricas")
Output:
integral((a^3*sec(f*x + e)^3 + 3*a^3*sec(f*x + e)^2 + 3*a^3*sec(f*x + e) + a^3)*sec(f*x + e)^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=a^{3} \left (\int 3 \sec {\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int 3 \sec ^{2}{\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int \sec ^{3}{\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int \sec ^{n}{\left (e + f x \right )}\, dx\right ) \] Input:
integrate(sec(f*x+e)**n*(a+a*sec(f*x+e))**3,x)
Output:
a**3*(Integral(3*sec(e + f*x)*sec(e + f*x)**n, x) + Integral(3*sec(e + f*x )**2*sec(e + f*x)**n, x) + Integral(sec(e + f*x)**3*sec(e + f*x)**n, x) + Integral(sec(e + f*x)**n, x))
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{3} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x, algorithm="maxima")
Output:
integrate((a*sec(f*x + e) + a)^3*sec(f*x + e)^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{3} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x, algorithm="giac")
Output:
integrate((a*sec(f*x + e) + a)^3*sec(f*x + e)^n, x)
Timed out. \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=\int {\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^3\,{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^n \,d x \] Input:
int((a + a/cos(e + f*x))^3*(1/cos(e + f*x))^n,x)
Output:
int((a + a/cos(e + f*x))^3*(1/cos(e + f*x))^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^3 \, dx=a^{3} \left (\int \sec \left (f x +e \right )^{n}d x +\int \sec \left (f x +e \right )^{n} \sec \left (f x +e \right )^{3}d x +3 \left (\int \sec \left (f x +e \right )^{n} \sec \left (f x +e \right )^{2}d x \right )+3 \left (\int \sec \left (f x +e \right )^{n} \sec \left (f x +e \right )d x \right )\right ) \] Input:
int(sec(f*x+e)^n*(a+a*sec(f*x+e))^3,x)
Output:
a**3*(int(sec(e + f*x)**n,x) + int(sec(e + f*x)**n*sec(e + f*x)**3,x) + 3* int(sec(e + f*x)**n*sec(e + f*x)**2,x) + 3*int(sec(e + f*x)**n*sec(e + f*x ),x))