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 ) \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{n+1}{2},\frac{n+3}{2},\cos ^2\left (-\tan ^{-1}(a,b)+c+d x\right )\right )}{d (n+1) \sqrt{\sin ^2\left (-\tan ^{-1}(a,b)+c+d x\right )}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0581775, antiderivative size = 136, normalized size of antiderivative = 1., 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]
[Out]
Rule 3078
Rule 2643
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.228257, 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 \text{Hypergeometric2F1}\left (\frac{1}{2},\frac{1-n}{2},\frac{3}{2},\cos ^2\left (\tan ^{-1}\left (\frac{a}{b}\right )+c+d x\right )\right )}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.415, size = 0, normalized size = 0. \begin{align*} \int \left ( a\cos \left ( dx+c \right ) +b\sin \left ( dx+c \right ) \right ) ^{n}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \cos \left (d x + c\right ) + b \sin \left (d x + c\right )\right )}^{n}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]