Integrand size = 37, antiderivative size = 170 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {C (b \cos (c+d x))^n \sin (c+d x)}{d (1+n)}-\frac {(A+A n+C n) (b \cos (c+d x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {2+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d n (1+n) \sqrt {\sin ^2(c+d x)}}-\frac {B (b \cos (c+d x))^{1+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b d (1+n) \sqrt {\sin ^2(c+d x)}} \] Output:
C*(b*cos(d*x+c))^n*sin(d*x+c)/d/(1+n)-(A*n+C*n+A)*(b*cos(d*x+c))^n*hyperge om([1/2, 1/2*n],[1+1/2*n],cos(d*x+c)^2)*sin(d*x+c)/d/n/(1+n)/(sin(d*x+c)^2 )^(1/2)-B*(b*cos(d*x+c))^(1+n)*hypergeom([1/2, 1/2+1/2*n],[3/2+1/2*n],cos( d*x+c)^2)*sin(d*x+c)/b/d/(1+n)/(sin(d*x+c)^2)^(1/2)
Time = 0.66 (sec) , antiderivative size = 138, normalized size of antiderivative = 0.81 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {b (b \cos (c+d x))^{-1+n} \cot (c+d x) \left (-\left ((A+A n+C n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {2+n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )+n \left (C \sin ^2(c+d x)-B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1+n}{2},\frac {3+n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )\right )}{d n (1+n)} \] Input:
Integrate[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x],x]
Output:
(b*(b*Cos[c + d*x])^(-1 + n)*Cot[c + d*x]*(-((A + A*n + C*n)*Hypergeometri c2F1[1/2, n/2, (2 + n)/2, Cos[c + d*x]^2]*Sqrt[Sin[c + d*x]^2]) + n*(C*Sin [c + d*x]^2 - B*Cos[c + d*x]*Hypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2, Cos[c + d*x]^2]*Sqrt[Sin[c + d*x]^2])))/(d*n*(1 + n))
Time = 0.56 (sec) , antiderivative size = 175, normalized size of antiderivative = 1.03, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.189, Rules used = {3042, 2030, 3502, 3042, 3227, 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 \sec (c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^n \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )}dx\) |
\(\Big \downarrow \) 2030 |
\(\displaystyle b \int \left (b \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )^{n-1} \left (C \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )^2+B \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )+A\right )dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle b \left (\frac {\int (b \cos (c+d x))^{n-1} (b (n A+A+C n)+b B (n+1) \cos (c+d x))dx}{b (n+1)}+\frac {C \sin (c+d x) (b \cos (c+d x))^n}{b d (n+1)}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (\frac {\int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-1} \left (b (n A+A+C n)+b B (n+1) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{b (n+1)}+\frac {C \sin (c+d x) (b \cos (c+d x))^n}{b d (n+1)}\right )\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle b \left (\frac {b (A n+A+C n) \int (b \cos (c+d x))^{n-1}dx+B (n+1) \int (b \cos (c+d x))^ndx}{b (n+1)}+\frac {C \sin (c+d x) (b \cos (c+d x))^n}{b d (n+1)}\right )\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle b \left (\frac {b (A n+A+C n) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-1}dx+B (n+1) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^ndx}{b (n+1)}+\frac {C \sin (c+d x) (b \cos (c+d x))^n}{b d (n+1)}\right )\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle b \left (\frac {-\frac {(A n+A+C n) \sin (c+d x) (b \cos (c+d x))^n \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n}{2},\frac {n+2}{2},\cos ^2(c+d x)\right )}{d n \sqrt {\sin ^2(c+d x)}}-\frac {B \sin (c+d x) (b \cos (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+1}{2},\frac {n+3}{2},\cos ^2(c+d x)\right )}{b d \sqrt {\sin ^2(c+d x)}}}{b (n+1)}+\frac {C \sin (c+d x) (b \cos (c+d x))^n}{b d (n+1)}\right )\) |
Input:
Int[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x ],x]
Output:
b*((C*(b*Cos[c + d*x])^n*Sin[c + d*x])/(b*d*(1 + n)) + (-(((A + A*n + C*n) *(b*Cos[c + d*x])^n*Hypergeometric2F1[1/2, n/2, (2 + n)/2, Cos[c + d*x]^2] *Sin[c + d*x])/(d*n*Sqrt[Sin[c + d*x]^2])) - (B*(b*Cos[c + d*x])^(1 + n)*H ypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2, Cos[c + d*x]^2]*Sin[c + d*x])/ (b*d*Sqrt[Sin[c + d*x]^2]))/(b*(1 + n)))
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[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
\[\int \left (b \cos \left (d x +c \right )\right )^{n} \left (A +B \cos \left (d x +c \right )+C \cos \left (d x +c \right )^{2}\right ) \sec \left (d x +c \right )d x\]
Input:
int((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x)
Output:
int((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x)
\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right ) \,d x } \] Input:
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x, a lgorithm="fricas")
Output:
integral((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d* x + c), x)
\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \left (b \cos {\left (c + d x \right )}\right )^{n} \left (A + B \cos {\left (c + d x \right )} + C \cos ^{2}{\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \] Input:
integrate((b*cos(d*x+c))**n*(A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c),x)
Output:
Integral((b*cos(c + d*x))**n*(A + B*cos(c + d*x) + C*cos(c + d*x)**2)*sec( c + d*x), x)
\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right ) \,d x } \] Input:
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x, a lgorithm="maxima")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d *x + c), x)
\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right ) \,d x } \] Input:
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x, a lgorithm="giac")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d *x + c), x)
Timed out. \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\int \frac {{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right )}{\cos \left (c+d\,x\right )} \,d x \] Input:
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d *x),x)
Output:
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d *x), x)
\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=b^{n} \left (\left (\int \cos \left (d x +c \right )^{n} \cos \left (d x +c \right ) \sec \left (d x +c \right )d x \right ) b +\left (\int \cos \left (d x +c \right )^{n} \cos \left (d x +c \right )^{2} \sec \left (d x +c \right )d x \right ) c +\left (\int \cos \left (d x +c \right )^{n} \sec \left (d x +c \right )d x \right ) a \right ) \] Input:
int((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c),x)
Output:
b**n*(int(cos(c + d*x)**n*cos(c + d*x)*sec(c + d*x),x)*b + int(cos(c + d*x )**n*cos(c + d*x)**2*sec(c + d*x),x)*c + int(cos(c + d*x)**n*sec(c + d*x), x)*a)