Integrand size = 29, antiderivative size = 153 \[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=-\frac {A b^3 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3-n}{2},\frac {5-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{-3+n} \sin (c+d x)}{d (3-n) \sqrt {\sin ^2(c+d x)}}-\frac {b^2 B \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(c+d x)\right ) (b \sec (c+d x))^{-2+n} \sin (c+d x)}{d (2-n) \sqrt {\sin ^2(c+d x)}} \] Output:
-A*b^3*hypergeom([1/2, 3/2-1/2*n],[5/2-1/2*n],cos(d*x+c)^2)*(b*sec(d*x+c)) ^(-3+n)*sin(d*x+c)/d/(3-n)/(sin(d*x+c)^2)^(1/2)-b^2*B*hypergeom([1/2, 1-1/ 2*n],[2-1/2*n],cos(d*x+c)^2)*(b*sec(d*x+c))^(-2+n)*sin(d*x+c)/d/(2-n)/(sin (d*x+c)^2)^(1/2)
Time = 0.21 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.75 \[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\frac {b \cot (c+d x) \left (A (-1+n) \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2+n),\frac {n}{2},\sec ^2(c+d x)\right )+B (-2+n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+n),\frac {1+n}{2},\sec ^2(c+d x)\right )\right ) (b \sec (c+d x))^{-1+n} \sqrt {-\tan ^2(c+d x)}}{d (-2+n) (-1+n)} \] Input:
Integrate[Cos[c + d*x]^2*(b*Sec[c + d*x])^n*(A + B*Sec[c + d*x]),x]
Output:
(b*Cot[c + d*x]*(A*(-1 + n)*Cos[c + d*x]*Hypergeometric2F1[1/2, (-2 + n)/2 , n/2, Sec[c + d*x]^2] + B*(-2 + n)*Hypergeometric2F1[1/2, (-1 + n)/2, (1 + n)/2, Sec[c + d*x]^2])*(b*Sec[c + d*x])^(-1 + n)*Sqrt[-Tan[c + d*x]^2])/ (d*(-2 + n)*(-1 + n))
Time = 0.54 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.99, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {3042, 2030, 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 \cos ^2(c+d x) (A+B \sec (c+d x)) (b \sec (c+d x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^n}{\csc \left (c+d x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 2030 |
\(\displaystyle b^2 \int \left (b \csc \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )^{n-2} \left (A+B \csc \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )dx\) |
\(\Big \downarrow \) 4274 |
\(\displaystyle b^2 \left (A \int (b \sec (c+d x))^{n-2}dx+\frac {B \int (b \sec (c+d x))^{n-1}dx}{b}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b^2 \left (A \int \left (b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^{n-2}dx+\frac {B \int \left (b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^{n-1}dx}{b}\right )\) |
\(\Big \downarrow \) 4259 |
\(\displaystyle b^2 \left (A \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n \int \left (\frac {\cos (c+d x)}{b}\right )^{2-n}dx+\frac {B \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n \int \left (\frac {\cos (c+d x)}{b}\right )^{1-n}dx}{b}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b^2 \left (A \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n \int \left (\frac {\sin \left (c+d x+\frac {\pi }{2}\right )}{b}\right )^{2-n}dx+\frac {B \left (\frac {\cos (c+d x)}{b}\right )^n (b \sec (c+d x))^n \int \left (\frac {\sin \left (c+d x+\frac {\pi }{2}\right )}{b}\right )^{1-n}dx}{b}\right )\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle b^2 \left (-\frac {A b \sin (c+d x) (b \sec (c+d x))^{n-3} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {3-n}{2},\frac {5-n}{2},\cos ^2(c+d x)\right )}{d (3-n) \sqrt {\sin ^2(c+d x)}}-\frac {B \sin (c+d x) (b \sec (c+d x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {2-n}{2},\frac {4-n}{2},\cos ^2(c+d x)\right )}{d (2-n) \sqrt {\sin ^2(c+d x)}}\right )\) |
Input:
Int[Cos[c + d*x]^2*(b*Sec[c + d*x])^n*(A + B*Sec[c + d*x]),x]
Output:
b^2*(-((A*b*Hypergeometric2F1[1/2, (3 - n)/2, (5 - n)/2, Cos[c + d*x]^2]*( b*Sec[c + d*x])^(-3 + n)*Sin[c + d*x])/(d*(3 - n)*Sqrt[Sin[c + d*x]^2])) - (B*Hypergeometric2F1[1/2, (2 - n)/2, (4 - n)/2, Cos[c + d*x]^2]*(b*Sec[c + d*x])^(-2 + n)*Sin[c + d*x])/(d*(2 - n)*Sqrt[Sin[c + d*x]^2]))
Int[(Fx_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Simp[1/b^m Int[(b*v) ^(m + n)*Fx, x], x] /; FreeQ[{b, n}, x] && IntegerQ[m]
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 \cos \left (d x +c \right )^{2} \left (b \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )\right )d x\]
Input:
int(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x)
Output:
int(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x)
\[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x, algorithm="fri cas")
Output:
integral((B*cos(d*x + c)^2*sec(d*x + c) + A*cos(d*x + c)^2)*(b*sec(d*x + c ))^n, x)
\[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\int \left (b \sec {\left (c + d x \right )}\right )^{n} \left (A + B \sec {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )}\, dx \] Input:
integrate(cos(d*x+c)**2*(b*sec(d*x+c))**n*(A+B*sec(d*x+c)),x)
Output:
Integral((b*sec(c + d*x))**n*(A + B*sec(c + d*x))*cos(c + d*x)**2, x)
\[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x, algorithm="max ima")
Output:
integrate((B*sec(d*x + c) + A)*(b*sec(d*x + c))^n*cos(d*x + c)^2, x)
\[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\int { {\left (B \sec \left (d x + c\right ) + A\right )} \left (b \sec \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x, algorithm="gia c")
Output:
integrate((B*sec(d*x + c) + A)*(b*sec(d*x + c))^n*cos(d*x + c)^2, x)
Timed out. \[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=\int {\cos \left (c+d\,x\right )}^2\,\left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,{\left (\frac {b}{\cos \left (c+d\,x\right )}\right )}^n \,d x \] Input:
int(cos(c + d*x)^2*(A + B/cos(c + d*x))*(b/cos(c + d*x))^n,x)
Output:
int(cos(c + d*x)^2*(A + B/cos(c + d*x))*(b/cos(c + d*x))^n, x)
\[ \int \cos ^2(c+d x) (b \sec (c+d x))^n (A+B \sec (c+d x)) \, dx=b^{n} \left (\left (\int \sec \left (d x +c \right )^{n} \cos \left (d x +c \right )^{2} \sec \left (d x +c \right )d x \right ) b +\left (\int \sec \left (d x +c \right )^{n} \cos \left (d x +c \right )^{2}d x \right ) a \right ) \] Input:
int(cos(d*x+c)^2*(b*sec(d*x+c))^n*(A+B*sec(d*x+c)),x)
Output:
b**n*(int(sec(c + d*x)**n*cos(c + d*x)**2*sec(c + d*x),x)*b + int(sec(c + d*x)**n*cos(c + d*x)**2,x)*a)