3.217 \(\int (a \cos (c+d x)+b \sin (c+d x))^n \, dx\)

Optimal. Leaf size=136 \[ -\frac {\sin \left (-\tan ^{-1}(a,b)+c+d x\right ) (a \cos (c+d x)+b \sin (c+d x))^n \left (\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}\right )^{-n} \cos ^{n+1}\left (-\tan ^{-1}(a,b)+c+d x\right ) \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2\left (c+d x-\tan ^{-1}(a,b)\right )\right )}{d (n+1) \sqrt {\sin ^2\left (-\tan ^{-1}(a,b)+c+d x\right )}} \]

[Out]

-cos(c+d*x-arctan(a,b))^(1+n)*hypergeom([1/2, 1/2+1/2*n],[3/2+1/2*n],cos(c+d*x-arctan(a,b))^2)*(a*cos(d*x+c)+b
*sin(d*x+c))^n*sin(c+d*x-arctan(a,b))/d/(1+n)/(((a*cos(d*x+c)+b*sin(d*x+c))/(a^2+b^2)^(1/2))^n)/(sin(c+d*x-arc
tan(a,b))^2)^(1/2)

________________________________________________________________________________________

Rubi [A]  time = 0.06, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3078, 2643} \[ -\frac {\sin \left (-\tan ^{-1}(a,b)+c+d x\right ) (a \cos (c+d x)+b \sin (c+d x))^n \left (\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}\right )^{-n} \cos ^{n+1}\left (-\tan ^{-1}(a,b)+c+d x\right ) \, _2F_1\left (\frac {1}{2},\frac {n+1}{2};\frac {n+3}{2};\cos ^2\left (c+d x-\tan ^{-1}(a,b)\right )\right )}{d (n+1) \sqrt {\sin ^2\left (-\tan ^{-1}(a,b)+c+d x\right )}} \]

Antiderivative was successfully verified.

[In]

Int[(a*Cos[c + d*x] + b*Sin[c + d*x])^n,x]

[Out]

-((Cos[c + d*x - ArcTan[a, b]]^(1 + n)*Hypergeometric2F1[1/2, (1 + n)/2, (3 + n)/2, Cos[c + d*x - ArcTan[a, b]
]^2]*(a*Cos[c + d*x] + b*Sin[c + d*x])^n*Sin[c + d*x - ArcTan[a, b]])/(d*(1 + n)*((a*Cos[c + d*x] + b*Sin[c +
d*x])/Sqrt[a^2 + b^2])^n*Sqrt[Sin[c + d*x - ArcTan[a, b]]^2]))

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 3078

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Dist[(a*Cos[c + d*x] +
b*Sin[c + d*x])^n/((a*Cos[c + d*x] + b*Sin[c + d*x])/Sqrt[a^2 + b^2])^n, Int[Cos[c + d*x - ArcTan[a, b]]^n, x]
, x] /; FreeQ[{a, b, c, d, n}, x] &&  !(GeQ[n, 1] || LeQ[n, -1]) &&  !(GtQ[a^2 + b^2, 0] || EqQ[a^2 + b^2, 0])

Rubi steps

\begin {align*} \int (a \cos (c+d x)+b \sin (c+d x))^n \, dx &=\left ((a \cos (c+d x)+b \sin (c+d x))^n \left (\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}\right )^{-n}\right ) \int \cos ^n\left (c+d x-\tan ^{-1}(a,b)\right ) \, dx\\ &=-\frac {\cos ^{1+n}\left (c+d x-\tan ^{-1}(a,b)\right ) \, _2F_1\left (\frac {1}{2},\frac {1+n}{2};\frac {3+n}{2};\cos ^2\left (c+d x-\tan ^{-1}(a,b)\right )\right ) (a \cos (c+d x)+b \sin (c+d x))^n \left (\frac {a \cos (c+d x)+b \sin (c+d x)}{\sqrt {a^2+b^2}}\right )^{-n} \sin \left (c+d x-\tan ^{-1}(a,b)\right )}{d (1+n) \sqrt {\sin ^2\left (c+d x-\tan ^{-1}(a,b)\right )}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.24, size = 94, normalized size = 0.69 \[ -\frac {\sin \left (2 \left (\tan ^{-1}\left (\frac {a}{b}\right )+c+d x\right )\right ) \sin ^2\left (\tan ^{-1}\left (\frac {a}{b}\right )+c+d x\right )^{-\frac {n}{2}-\frac {1}{2}} (a \cos (c+d x)+b \sin (c+d x))^n \, _2F_1\left (\frac {1}{2},\frac {1-n}{2};\frac {3}{2};\cos ^2\left (c+d x+\tan ^{-1}\left (\frac {a}{b}\right )\right )\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Cos[c + d*x] + b*Sin[c + d*x])^n,x]

[Out]

-1/2*(Hypergeometric2F1[1/2, (1 - n)/2, 3/2, Cos[c + d*x + ArcTan[a/b]]^2]*(a*Cos[c + d*x] + b*Sin[c + d*x])^n
*(Sin[c + d*x + ArcTan[a/b]]^2)^(-1/2 - n/2)*Sin[2*(c + d*x + ArcTan[a/b])])/d

________________________________________________________________________________________

fricas [F]  time = 1.86, size = 0, normalized size = 0.00 \[ {\rm integral}\left ({\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^n,x, algorithm="fricas")

[Out]

integral((a*cos(d*x + c) + b*sin(d*x + c))^n, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((a*cos(d*x + c) + b*sin(d*x + c))^n, x)

________________________________________________________________________________________

maple [F]  time = 1.00, size = 0, normalized size = 0.00 \[ \int \left (a \cos \left (d x +c \right )+b \sin \left (d x +c \right )\right )^{n}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(d*x+c)+b*sin(d*x+c))^n,x)

[Out]

int((a*cos(d*x+c)+b*sin(d*x+c))^n,x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((a*cos(d*x + c) + b*sin(d*x + c))^n, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int {\left (a\,\cos \left (c+d\,x\right )+b\,\sin \left (c+d\,x\right )\right )}^n \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cos(c + d*x) + b*sin(c + d*x))^n,x)

[Out]

int((a*cos(c + d*x) + b*sin(c + d*x))^n, x)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cos(d*x+c)+b*sin(d*x+c))**n,x)

[Out]

Timed out

________________________________________________________________________________________