Optimal. Leaf size=155 \[ \frac {a^3 \cos ^{m+3}(c+d x)}{d (m+3)}-\frac {a \left (a^2-3 b^2\right ) \cos ^{m+1}(c+d x)}{d (m+1)}-\frac {b \left (3 a^2-b^2\right ) \cos ^m(c+d x)}{d m}+\frac {3 a^2 b \cos ^{m+2}(c+d x)}{d (m+2)}+\frac {3 a b^2 \cos ^{m-1}(c+d x)}{d (1-m)}+\frac {b^3 \cos ^{m-2}(c+d x)}{d (2-m)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.38, antiderivative size = 155, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.107, Rules used = {4397, 2837, 948} \[ -\frac {b \left (3 a^2-b^2\right ) \cos ^m(c+d x)}{d m}-\frac {a \left (a^2-3 b^2\right ) \cos ^{m+1}(c+d x)}{d (m+1)}+\frac {3 a^2 b \cos ^{m+2}(c+d x)}{d (m+2)}+\frac {a^3 \cos ^{m+3}(c+d x)}{d (m+3)}+\frac {3 a b^2 \cos ^{m-1}(c+d x)}{d (1-m)}+\frac {b^3 \cos ^{m-2}(c+d x)}{d (2-m)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 948
Rule 2837
Rule 4397
Rubi steps
\begin {align*} \int \cos ^m(c+d x) (a \sin (c+d x)+b \tan (c+d x))^3 \, dx &=\int \cos ^{-3+m}(c+d x) (b+a \cos (c+d x))^3 \sin ^3(c+d x) \, dx\\ &=-\frac {\operatorname {Subst}\left (\int \left (\frac {x}{a}\right )^{-3+m} (b+x)^3 \left (a^2-x^2\right ) \, dx,x,a \cos (c+d x)\right )}{a^3 d}\\ &=-\frac {\operatorname {Subst}\left (\int \left (a^2 b^3 \left (\frac {x}{a}\right )^{-3+m}+3 a^3 b^2 \left (\frac {x}{a}\right )^{-2+m}+a^2 b \left (3 a^2-b^2\right ) \left (\frac {x}{a}\right )^{-1+m}+a^3 \left (a^2-3 b^2\right ) \left (\frac {x}{a}\right )^m-3 a^4 b \left (\frac {x}{a}\right )^{1+m}-a^5 \left (\frac {x}{a}\right )^{2+m}\right ) \, dx,x,a \cos (c+d x)\right )}{a^3 d}\\ &=\frac {b^3 \cos ^{-2+m}(c+d x)}{d (2-m)}+\frac {3 a b^2 \cos ^{-1+m}(c+d x)}{d (1-m)}-\frac {b \left (3 a^2-b^2\right ) \cos ^m(c+d x)}{d m}-\frac {a \left (a^2-3 b^2\right ) \cos ^{1+m}(c+d x)}{d (1+m)}+\frac {3 a^2 b \cos ^{2+m}(c+d x)}{d (2+m)}+\frac {a^3 \cos ^{3+m}(c+d x)}{d (3+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.45, size = 246, normalized size = 1.59 \[ \frac {\cos ^{m+1}(c+d x) (a+b \sec (c+d x))^3 \left (-a m \left (m^3-m^2-4 m+4\right ) \left (a^2 (m+9)-12 b^2 (m+3)\right ) \cos ^3(c+d x)+\left (m^3-2 m^2-m+2\right ) \cos ^2(c+d x) \left (a^3 m (m+2) \cos (3 (c+d x))+2 b (m+3) \left (2 b^2 (m+2)-3 a^2 (m+4)\right )+6 a^2 b m (m+3) \cos (2 (c+d x))\right )-12 a b^2 m \left (m^4+4 m^3-m^2-16 m-12\right ) \cos (c+d x)-4 b^3 m \left (m^4+5 m^3+5 m^2-5 m-6\right )\right )}{4 d (m-2) (m-1) m (m+1) (m+2) (m+3) (a \cos (c+d x)+b)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.53, size = 412, normalized size = 2.66 \[ -\frac {{\left (b^{3} m^{5} + 5 \, b^{3} m^{4} + 5 \, b^{3} m^{3} - {\left (a^{3} m^{5} - 5 \, a^{3} m^{3} + 4 \, a^{3} m\right )} \cos \left (d x + c\right )^{5} - 5 \, b^{3} m^{2} - 3 \, {\left (a^{2} b m^{5} + a^{2} b m^{4} - 7 \, a^{2} b m^{3} - a^{2} b m^{2} + 6 \, a^{2} b m\right )} \cos \left (d x + c\right )^{4} - 6 \, b^{3} m + {\left ({\left (a^{3} - 3 \, a b^{2}\right )} m^{5} + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} m^{4} - 7 \, {\left (a^{3} - 3 \, a b^{2}\right )} m^{3} - 8 \, {\left (a^{3} - 3 \, a b^{2}\right )} m^{2} + 12 \, {\left (a^{3} - 3 \, a b^{2}\right )} m\right )} \cos \left (d x + c\right )^{3} + {\left ({\left (3 \, a^{2} b - b^{3}\right )} m^{5} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} m^{4} - 5 \, {\left (3 \, a^{2} b - b^{3}\right )} m^{3} + 36 \, a^{2} b - 12 \, b^{3} - 15 \, {\left (3 \, a^{2} b - b^{3}\right )} m^{2} + 4 \, {\left (3 \, a^{2} b - b^{3}\right )} m\right )} \cos \left (d x + c\right )^{2} + 3 \, {\left (a b^{2} m^{5} + 4 \, a b^{2} m^{4} - a b^{2} m^{3} - 16 \, a b^{2} m^{2} - 12 \, a b^{2} m\right )} \cos \left (d x + c\right )\right )} \cos \left (d x + c\right )^{m}}{{\left (d m^{6} + 3 \, d m^{5} - 5 \, d m^{4} - 15 \, d m^{3} + 4 \, d m^{2} + 12 \, d m\right )} \cos \left (d x + c\right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 4.64, size = 0, normalized size = 0.00 \[ \int \left (\cos ^{m}\left (d x +c \right )\right ) \left (a \sin \left (d x +c \right )+b \tan \left (d x +c \right )\right )^{3}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.36, size = 180, normalized size = 1.16 \[ \frac {\frac {{\left ({\left (m + 1\right )} \cos \left (d x + c\right )^{3} - {\left (m + 3\right )} \cos \left (d x + c\right )\right )} a^{3} \cos \left (d x + c\right )^{m}}{m^{2} + 4 \, m + 3} + \frac {3 \, {\left (m \cos \left (d x + c\right )^{2} - m - 2\right )} a^{2} b \cos \left (d x + c\right )^{m}}{m^{2} + 2 \, m} + \frac {3 \, {\left ({\left (m - 1\right )} \cos \left (d x + c\right )^{2} - m - 1\right )} a b^{2} \cos \left (d x + c\right )^{m}}{{\left (m^{2} - 1\right )} \cos \left (d x + c\right )} + \frac {{\left ({\left (m - 2\right )} \cos \left (d x + c\right )^{2} - m\right )} b^{3} \cos \left (d x + c\right )^{m}}{{\left (m^{2} - 2 \, m\right )} \cos \left (d x + c\right )^{2}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 7.51, size = 861, normalized size = 5.55 \[ \frac {{\left (\frac {1}{2}\right )}^m\,{\left ({\mathrm {e}}^{-c\,1{}\mathrm {i}-d\,x\,1{}\mathrm {i}}+{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\right )}^m\,\left (\frac {a^3\,\left (\frac {m^4}{8}-\frac {5\,m^2}{8}+\frac {1}{2}\right )}{d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {a^3\,{\mathrm {e}}^{c\,10{}\mathrm {i}+d\,x\,10{}\mathrm {i}}\,\left (m^4-5\,m^2+4\right )}{8\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}-\frac {a\,{\mathrm {e}}^{c\,2{}\mathrm {i}+d\,x\,2{}\mathrm {i}}\,\left (-m^3+m^2+4\,m-4\right )\,\left (a^2\,m+12\,b^2\,m-7\,a^2+36\,b^2\right )}{8\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}-\frac {a\,{\mathrm {e}}^{c\,8{}\mathrm {i}+d\,x\,8{}\mathrm {i}}\,\left (-m^3+m^2+4\,m-4\right )\,\left (a^2\,m+12\,b^2\,m-7\,a^2+36\,b^2\right )}{8\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {3\,a^2\,b\,{\mathrm {e}}^{c\,1{}\mathrm {i}+d\,x\,1{}\mathrm {i}}\,\left (m^4+m^3-7\,m^2-m+6\right )}{4\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {3\,a^2\,b\,{\mathrm {e}}^{c\,9{}\mathrm {i}+d\,x\,9{}\mathrm {i}}\,\left (m^4+m^3-7\,m^2-m+6\right )}{4\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}-\frac {a\,{\mathrm {e}}^{c\,4{}\mathrm {i}+d\,x\,4{}\mathrm {i}}\,\left (m^2-4\right )\,\left (a^2\,m^2+12\,a^2\,m-13\,a^2+6\,b^2\,m^2+60\,b^2\,m+126\,b^2\right )}{4\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}-\frac {a\,{\mathrm {e}}^{c\,6{}\mathrm {i}+d\,x\,6{}\mathrm {i}}\,\left (m^2-4\right )\,\left (a^2\,m^2+12\,a^2\,m-13\,a^2+6\,b^2\,m^2+60\,b^2\,m+126\,b^2\right )}{4\,d\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {b\,{\mathrm {e}}^{c\,3{}\mathrm {i}+d\,x\,3{}\mathrm {i}}\,\left (b^2\,m-6\,a^2+2\,b^2\right )\,\left (m^4+m^3-7\,m^2-m+6\right )}{d\,m\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {b\,{\mathrm {e}}^{c\,7{}\mathrm {i}+d\,x\,7{}\mathrm {i}}\,\left (b^2\,m-6\,a^2+2\,b^2\right )\,\left (m^4+m^3-7\,m^2-m+6\right )}{d\,m\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}+\frac {b\,{\mathrm {e}}^{c\,5{}\mathrm {i}+d\,x\,5{}\mathrm {i}}\,\left (-m^3-3\,m^2+m+3\right )\,\left (3\,a^2\,m^2+18\,a^2\,m-48\,a^2+4\,b^2\,m^2+16\,b^2\,m+16\,b^2\right )}{2\,d\,m\,\left (m^5+3\,m^4-5\,m^3-15\,m^2+4\,m+12\right )}\right )}{{\mathrm {e}}^{c\,3{}\mathrm {i}+d\,x\,3{}\mathrm {i}}+2\,{\mathrm {e}}^{c\,5{}\mathrm {i}+d\,x\,5{}\mathrm {i}}+{\mathrm {e}}^{c\,7{}\mathrm {i}+d\,x\,7{}\mathrm {i}}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{3} \cos ^{m}{\left (c + d x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________