Integrand size = 21, antiderivative size = 304 \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=\frac {a^4 \left (30+21 n+4 n^2\right ) \sec ^{1+n}(e+f x) \sin (e+f x)}{f (1+n) (2+n) (3+n)}+\frac {\sec ^{1+n}(e+f x) \left (a^2+a^2 \sec (e+f x)\right )^2 \sin (e+f x)}{f (3+n)}+\frac {2 (4+n) \sec ^{1+n}(e+f x) \left (a^4+a^4 \sec (e+f x)\right ) \sin (e+f x)}{f (2+n) (3+n)}-\frac {a^4 \left (3+24 n+8 n^2\right ) \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 (1-n) (1+n) (3+n) \sqrt {\sin ^2(e+f x)}}+\frac {4 a^4 (3+2 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^4*(4*n^2+21*n+30)*sec(f*x+e)^(1+n)*sin(f*x+e)/f/(1+n)/(2+n)/(3+n)+sec(f* x+e)^(1+n)*(a^2+a^2*sec(f*x+e))^2*sin(f*x+e)/f/(3+n)+2*(4+n)*sec(f*x+e)^(1 +n)*(a^4+a^4*sec(f*x+e))*sin(f*x+e)/f/(2+n)/(3+n)-a^4*(8*n^2+24*n+3)*hyper geom([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/(1-n)/(1+n)/(3+n)/(sin(f*x+e)^2)^(1/2)+4*a^4*(3+2*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 = 3.56 (sec) , antiderivative size = 208, normalized size of antiderivative = 0.68 \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=\frac {a^4 \csc (e+f x) \sec ^{-1+n}(e+f x) \left (n \left (40+34 n+7 n^2+4 \left (3+4 n+n^2\right ) \sec (e+f x)+\left (2+3 n+n^2\right ) \sec ^2(e+f x)\right ) \tan ^2(e+f x)+\left (6+51 n+40 n^2+8 n^3\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)}+4 n \left (9+9 n+2 n^2\right ) \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) (3+n)} \] Input:
Integrate[Sec[e + f*x]^n*(a + a*Sec[e + f*x])^4,x]
Output:
(a^4*Csc[e + f*x]*Sec[e + f*x]^(-1 + n)*(n*(40 + 34*n + 7*n^2 + 4*(3 + 4*n + n^2)*Sec[e + f*x] + (2 + 3*n + n^2)*Sec[e + f*x]^2)*Tan[e + f*x]^2 + (6 + 51*n + 40*n^2 + 8*n^3)*Hypergeometric2F1[1/2, n/2, (2 + n)/2, Sec[e + f *x]^2]*Sqrt[-Tan[e + f*x]^2] + 4*n*(9 + 9*n + 2*n^2)*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)*(3 + n))
Time = 1.36 (sec) , antiderivative size = 305, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.571, Rules used = {3042, 4301, 3042, 4506, 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)^4 \sec ^n(e+f x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^4 \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 (2 n+3)+2 a (n+4) \sec (e+f x))dx}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\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 )^2 \left (a (2 n+3)+2 a (n+4) \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 4506 |
\(\displaystyle \frac {a \left (\frac {\int \sec ^n(e+f x) (\sec (e+f x) a+a) \left (\left (4 n^2+15 n+6\right ) a^2+\left (4 n^2+21 n+30\right ) \sec (e+f x) a^2\right )dx}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {\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 (\left (4 n^2+15 n+6\right ) a^2+\left (4 n^2+21 n+30\right ) \csc \left (e+f x+\frac {\pi }{2}\right ) a^2\right )dx}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 4485 |
\(\displaystyle \frac {a \left (\frac {\frac {\int \sec ^n(e+f x) \left ((n+2) \left (8 n^2+24 n+3\right ) a^3+4 (n+1) (n+3) (2 n+3) \sec (e+f x) a^3\right )dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {\frac {\int \csc \left (e+f x+\frac {\pi }{2}\right )^n \left ((n+2) \left (8 n^2+24 n+3\right ) a^3+4 (n+1) (n+3) (2 n+3) \csc \left (e+f x+\frac {\pi }{2}\right ) a^3\right )dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle \frac {a \left (\frac {\frac {a^3 (n+2) \left (8 n^2+24 n+3\right ) \int \sec ^n(e+f x)dx+4 a^3 (n+1) (n+3) (2 n+3) \int \sec ^{n+1}(e+f x)dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {\frac {a^3 (n+2) \left (8 n^2+24 n+3\right ) \int \csc \left (e+f x+\frac {\pi }{2}\right )^ndx+4 a^3 (n+1) (n+3) (2 n+3) \int \csc \left (e+f x+\frac {\pi }{2}\right )^{n+1}dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle \frac {a \left (\frac {\frac {a^3 (n+2) \left (8 n^2+24 n+3\right ) \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{-n}(e+f x)dx+4 a^3 (n+1) (n+3) (2 n+3) \cos ^n(e+f x) \sec ^n(e+f x) \int \cos ^{-n-1}(e+f x)dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {a \left (\frac {\frac {a^3 (n+2) \left (8 n^2+24 n+3\right ) \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{-n}dx+4 a^3 (n+1) (n+3) (2 n+3) \cos ^n(e+f x) \sec ^n(e+f x) \int \sin \left (e+f x+\frac {\pi }{2}\right )^{-n-1}dx}{n+1}+\frac {a^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {a \left (\frac {\frac {\frac {4 a^3 (n+1) (n+3) (2 n+3) \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^3 (n+2) \left (8 n^2+24 n+3\right ) \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^3 \left (4 n^2+21 n+30\right ) \sin (e+f x) \sec ^{n+1}(e+f x)}{f (n+1)}}{n+2}+\frac {2 (n+4) \sin (e+f x) \left (a^3 \sec (e+f x)+a^3\right ) \sec ^{n+1}(e+f x)}{f (n+2)}\right )}{n+3}+\frac {\sin (e+f x) \left (a^2 \sec (e+f x)+a^2\right )^2 \sec ^{n+1}(e+f x)}{f (n+3)}\) |
Input:
Int[Sec[e + f*x]^n*(a + a*Sec[e + f*x])^4,x]
Output:
(Sec[e + f*x]^(1 + n)*(a^2 + a^2*Sec[e + f*x])^2*Sin[e + f*x])/(f*(3 + n)) + (a*((2*(4 + n)*Sec[e + f*x]^(1 + n)*(a^3 + a^3*Sec[e + f*x])*Sin[e + f* x])/(f*(2 + n)) + ((a^3*(30 + 21*n + 4*n^2)*Sec[e + f*x]^(1 + n)*Sin[e + f *x])/(f*(1 + n)) + (-((a^3*(2 + n)*(3 + 24*n + 8*n^2)*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])) + (4*a^3*(1 + n)*(3 + n)*(3 + 2*n)*Hy pergeometric2F1[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)))/(3 + 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[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-b)*B* Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 1)*((d*Csc[e + f*x])^n/(f*(m + n))), x] + Simp[1/(d*(m + n)) Int[(a + b*Csc[e + f*x])^(m - 1)*(d*Csc[e + f*x] )^n*Simp[a*A*d*(m + n) + B*(b*d*n) + (A*b*d*(m + n) + a*B*d*(2*m + n - 1))* Csc[e + f*x], x], x], x] /; FreeQ[{a, b, d, e, f, A, B, n}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && GtQ[m, 1/2] && !LtQ[n, -1]
\[\int \sec \left (f x +e \right )^{n} \left (a +a \sec \left (f x +e \right )\right )^{4}d x\]
Input:
int(sec(f*x+e)^n*(a+a*sec(f*x+e))^4,x)
Output:
int(sec(f*x+e)^n*(a+a*sec(f*x+e))^4,x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{4} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^4,x, algorithm="fricas")
Output:
integral((a^4*sec(f*x + e)^4 + 4*a^4*sec(f*x + e)^3 + 6*a^4*sec(f*x + e)^2 + 4*a^4*sec(f*x + e) + a^4)*sec(f*x + e)^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=a^{4} \left (\int 4 \sec {\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int 6 \sec ^{2}{\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int 4 \sec ^{3}{\left (e + f x \right )} \sec ^{n}{\left (e + f x \right )}\, dx + \int \sec ^{4}{\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))**4,x)
Output:
a**4*(Integral(4*sec(e + f*x)*sec(e + f*x)**n, x) + Integral(6*sec(e + f*x )**2*sec(e + f*x)**n, x) + Integral(4*sec(e + f*x)**3*sec(e + f*x)**n, x) + Integral(sec(e + f*x)**4*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))^4 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{4} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^4,x, algorithm="maxima")
Output:
integrate((a*sec(f*x + e) + a)^4*sec(f*x + e)^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{4} \sec \left (f x + e\right )^{n} \,d x } \] Input:
integrate(sec(f*x+e)^n*(a+a*sec(f*x+e))^4,x, algorithm="giac")
Output:
integrate((a*sec(f*x + e) + a)^4*sec(f*x + e)^n, x)
Timed out. \[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=\int {\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^4\,{\left (\frac {1}{\cos \left (e+f\,x\right )}\right )}^n \,d x \] Input:
int((a + a/cos(e + f*x))^4*(1/cos(e + f*x))^n,x)
Output:
int((a + a/cos(e + f*x))^4*(1/cos(e + f*x))^n, x)
\[ \int \sec ^n(e+f x) (a+a \sec (e+f x))^4 \, dx=a^{4} \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 )^{4}d x +4 \left (\int \sec \left (f x +e \right )^{n} \sec \left (f x +e \right )^{3}d x \right )+6 \left (\int \sec \left (f x +e \right )^{n} \sec \left (f x +e \right )^{2}d x \right )+4 \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))^4,x)
Output:
a**4*(int(sec(e + f*x)**n,x) + int(sec(e + f*x)**n*sec(e + f*x)**4,x) + 4* int(sec(e + f*x)**n*sec(e + f*x)**3,x) + 6*int(sec(e + f*x)**n*sec(e + f*x )**2,x) + 4*int(sec(e + f*x)**n*sec(e + f*x),x))