Integrand size = 38, antiderivative size = 141 \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {B (b \cos (c+d x))^{4+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^4 d (4+n) \sqrt {\sin ^2(c+d x)}}-\frac {C (b \cos (c+d x))^{5+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {5+n}{2},\frac {7+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{b^5 d (5+n) \sqrt {\sin ^2(c+d x)}} \] Output:
-B*(b*cos(d*x+c))^(4+n)*hypergeom([1/2, 2+1/2*n],[3+1/2*n],cos(d*x+c)^2)*s in(d*x+c)/b^4/d/(4+n)/(sin(d*x+c)^2)^(1/2)-C*(b*cos(d*x+c))^(5+n)*hypergeo m([1/2, 5/2+1/2*n],[7/2+1/2*n],cos(d*x+c)^2)*sin(d*x+c)/b^5/d/(5+n)/(sin(d *x+c)^2)^(1/2)
Time = 0.49 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.85 \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=-\frac {\cos ^3(c+d x) (b \cos (c+d x))^n \cot (c+d x) \left (B (5+n) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {4+n}{2},\frac {6+n}{2},\cos ^2(c+d x)\right )+C (4+n) \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {5+n}{2},\frac {7+n}{2},\cos ^2(c+d x)\right )\right ) \sqrt {\sin ^2(c+d x)}}{d (4+n) (5+n)} \] Input:
Integrate[Cos[c + d*x]^2*(b*Cos[c + d*x])^n*(B*Cos[c + d*x] + C*Cos[c + d* x]^2),x]
Output:
-((Cos[c + d*x]^3*(b*Cos[c + d*x])^n*Cot[c + d*x]*(B*(5 + n)*Hypergeometri c2F1[1/2, (4 + n)/2, (6 + n)/2, Cos[c + d*x]^2] + C*(4 + n)*Cos[c + d*x]*H ypergeometric2F1[1/2, (5 + n)/2, (7 + n)/2, Cos[c + d*x]^2])*Sqrt[Sin[c + d*x]^2])/(d*(4 + n)*(5 + n)))
Time = 0.51 (sec) , antiderivative size = 145, 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.184, Rules used = {2030, 3042, 3489, 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 \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 2030 |
\(\displaystyle \frac {\int (b \cos (c+d x))^{n+2} \left (C \cos ^2(c+d x)+B \cos (c+d x)\right )dx}{b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n+2} \left (C \sin \left (c+d x+\frac {\pi }{2}\right )^2+B \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{b^2}\) |
\(\Big \downarrow \) 3489 |
\(\displaystyle \frac {\int (b \cos (c+d x))^{n+3} (B+C \cos (c+d x))dx}{b^3}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n+3} \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{b^3}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {B \int (b \cos (c+d x))^{n+3}dx+\frac {C \int (b \cos (c+d x))^{n+4}dx}{b}}{b^3}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {B \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n+3}dx+\frac {C \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n+4}dx}{b}}{b^3}\) |
\(\Big \downarrow \) 3122 |
\(\displaystyle \frac {-\frac {C \sin (c+d x) (b \cos (c+d x))^{n+5} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+5}{2},\frac {n+7}{2},\cos ^2(c+d x)\right )}{b^2 d (n+5) \sqrt {\sin ^2(c+d x)}}-\frac {B \sin (c+d x) (b \cos (c+d x))^{n+4} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n+4}{2},\frac {n+6}{2},\cos ^2(c+d x)\right )}{b d (n+4) \sqrt {\sin ^2(c+d x)}}}{b^3}\) |
Input:
Int[Cos[c + d*x]^2*(b*Cos[c + d*x])^n*(B*Cos[c + d*x] + C*Cos[c + d*x]^2), x]
Output:
(-((B*(b*Cos[c + d*x])^(4 + n)*Hypergeometric2F1[1/2, (4 + n)/2, (6 + n)/2 , Cos[c + d*x]^2]*Sin[c + d*x])/(b*d*(4 + n)*Sqrt[Sin[c + d*x]^2])) - (C*( b*Cos[c + d*x])^(5 + n)*Hypergeometric2F1[1/2, (5 + n)/2, (7 + n)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(b^2*d*(5 + n)*Sqrt[Sin[c + d*x]^2]))/b^3
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[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b Int[(b*Sin[e + f* x])^(m + 1)*(B + C*Sin[e + f*x]), x], x] /; FreeQ[{b, e, f, B, C, m}, x]
\[\int \cos \left (d x +c \right )^{2} \left (b \cos \left (d x +c \right )\right )^{n} \left (B \cos \left (d x +c \right )+C \cos \left (d x +c \right )^{2}\right )d x\]
Input:
int(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x)
Output:
int(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x)
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, a lgorithm="fricas")
Output:
integral((C*cos(d*x + c)^4 + B*cos(d*x + c)^3)*(b*cos(d*x + c))^n, x)
Timed out. \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\text {Timed out} \] Input:
integrate(cos(d*x+c)**2*(b*cos(d*x+c))**n*(B*cos(d*x+c)+C*cos(d*x+c)**2),x )
Output:
Timed out
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, a lgorithm="maxima")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*(b*cos(d*x + c))^n*cos(d*x + c)^2, x)
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right )\right )} \left (b \cos \left (d x + c\right )\right )^{n} \cos \left (d x + c\right )^{2} \,d x } \] Input:
integrate(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x, a lgorithm="giac")
Output:
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c))*(b*cos(d*x + c))^n*cos(d*x + c)^2, x)
Timed out. \[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\int {\cos \left (c+d\,x\right )}^2\,{\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 )\right ) \,d x \] Input:
int(cos(c + d*x)^2*(b*cos(c + d*x))^n*(B*cos(c + d*x) + C*cos(c + d*x)^2), x)
Output:
int(cos(c + d*x)^2*(b*cos(c + d*x))^n*(B*cos(c + d*x) + C*cos(c + d*x)^2), x)
\[ \int \cos ^2(c+d x) (b \cos (c+d x))^n \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=b^{n} \left (\left (\int \cos \left (d x +c \right )^{n} \cos \left (d x +c \right )^{4}d x \right ) c +\left (\int \cos \left (d x +c \right )^{n} \cos \left (d x +c \right )^{3}d x \right ) b \right ) \] Input:
int(cos(d*x+c)^2*(b*cos(d*x+c))^n*(B*cos(d*x+c)+C*cos(d*x+c)^2),x)
Output:
b**n*(int(cos(c + d*x)**n*cos(c + d*x)**4,x)*c + int(cos(c + d*x)**n*cos(c + d*x)**3,x)*b)