Integrand size = 19, antiderivative size = 58 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=-\frac {\left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x))}{d}+\frac {(b \cos (c+d x)-a \sin (c+d x))^3}{3 d} \] Output:
-(a^2+b^2)*(b*cos(d*x+c)-a*sin(d*x+c))/d+1/3*(b*cos(d*x+c)-a*sin(d*x+c))^3 /d
Time = 0.49 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.40 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {-9 b \left (a^2+b^2\right ) \cos (c+d x)+\left (-3 a^2 b+b^3\right ) \cos (3 (c+d x))+2 a \left (5 a^2+3 b^2+\left (a^2-3 b^2\right ) \cos (2 (c+d x))\right ) \sin (c+d x)}{12 d} \] Input:
Integrate[(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
Output:
(-9*b*(a^2 + b^2)*Cos[c + d*x] + (-3*a^2*b + b^3)*Cos[3*(c + d*x)] + 2*a*( 5*a^2 + 3*b^2 + (a^2 - 3*b^2)*Cos[2*(c + d*x)])*Sin[c + d*x])/(12*d)
Time = 0.21 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.97, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3042, 3551, 2009}
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 (a \cos (c+d x)+b \sin (c+d x))^3 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \cos (c+d x)+b \sin (c+d x))^3dx\) |
\(\Big \downarrow \) 3551 |
\(\displaystyle -\frac {\int \left (a^2+b^2-(b \cos (c+d x)-a \sin (c+d x))^2\right )d(b \cos (c+d x)-a \sin (c+d x))}{d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle -\frac {\left (a^2+b^2\right ) (b \cos (c+d x)-a \sin (c+d x))-\frac {1}{3} (b \cos (c+d x)-a \sin (c+d x))^3}{d}\) |
Input:
Int[(a*Cos[c + d*x] + b*Sin[c + d*x])^3,x]
Output:
-(((a^2 + b^2)*(b*Cos[c + d*x] - a*Sin[c + d*x]) - (b*Cos[c + d*x] - a*Sin [c + d*x])^3/3)/d)
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x _Symbol] :> Simp[-d^(-1) Subst[Int[(a^2 + b^2 - x^2)^((n - 1)/2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0] && IGtQ[(n - 1)/2, 0]
Time = 1.05 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.29
method | result | size |
derivativedivides | \(\frac {\frac {a^{3} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}-a^{2} b \cos \left (d x +c \right )^{3}+a \,b^{2} \sin \left (d x +c \right )^{3}-\frac {b^{3} \left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}}{d}\) | \(75\) |
default | \(\frac {\frac {a^{3} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3}-a^{2} b \cos \left (d x +c \right )^{3}+a \,b^{2} \sin \left (d x +c \right )^{3}-\frac {b^{3} \left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3}}{d}\) | \(75\) |
parts | \(\frac {a^{3} \left (2+\cos \left (d x +c \right )^{2}\right ) \sin \left (d x +c \right )}{3 d}-\frac {b^{3} \left (2+\sin \left (d x +c \right )^{2}\right ) \cos \left (d x +c \right )}{3 d}-\frac {a^{2} b \cos \left (d x +c \right )^{3}}{d}+\frac {a \,b^{2} \sin \left (d x +c \right )^{3}}{d}\) | \(83\) |
parallelrisch | \(\frac {2 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}-6 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a^{2} b +\frac {4 \left (a^{3}+6 a \,b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3}-4 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 a^{2} b -\frac {4 b^{3}}{3}}{d \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}\) | \(119\) |
risch | \(-\frac {3 b \cos \left (d x +c \right ) a^{2}}{4 d}-\frac {3 b^{3} \cos \left (d x +c \right )}{4 d}+\frac {3 a^{3} \sin \left (d x +c \right )}{4 d}+\frac {3 a \sin \left (d x +c \right ) b^{2}}{4 d}-\frac {b \cos \left (3 d x +3 c \right ) a^{2}}{4 d}+\frac {b^{3} \cos \left (3 d x +3 c \right )}{12 d}+\frac {a^{3} \sin \left (3 d x +3 c \right )}{12 d}-\frac {a \sin \left (3 d x +3 c \right ) b^{2}}{4 d}\) | \(130\) |
norman | \(\frac {-\frac {6 a^{2} b +4 b^{3}}{3 d}+\frac {2 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {4 b^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{d}-\frac {6 a^{2} b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{d}+\frac {4 a \left (a^{2}+6 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}\) | \(136\) |
orering | \(-\frac {10 \left (\cos \left (d x +c \right ) a +b \sin \left (d x +c \right )\right )^{2} \left (-\sin \left (d x +c \right ) d a +b d \cos \left (d x +c \right )\right )}{3 d^{2}}-\frac {6 \left (-\sin \left (d x +c \right ) d a +b d \cos \left (d x +c \right )\right )^{3}+18 \left (\cos \left (d x +c \right ) a +b \sin \left (d x +c \right )\right ) \left (-\sin \left (d x +c \right ) d a +b d \cos \left (d x +c \right )\right ) \left (-d^{2} \cos \left (d x +c \right ) a -b \,d^{2} \sin \left (d x +c \right )\right )+3 \left (\cos \left (d x +c \right ) a +b \sin \left (d x +c \right )\right )^{2} \left (d^{3} \sin \left (d x +c \right ) a -b \,d^{3} \cos \left (d x +c \right )\right )}{9 d^{4}}\) | \(185\) |
Input:
int((cos(d*x+c)*a+b*sin(d*x+c))^3,x,method=_RETURNVERBOSE)
Output:
1/d*(1/3*a^3*(2+cos(d*x+c)^2)*sin(d*x+c)-a^2*b*cos(d*x+c)^3+a*b^2*sin(d*x+ c)^3-1/3*b^3*(2+sin(d*x+c)^2)*cos(d*x+c))
Time = 0.07 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.33 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=-\frac {3 \, b^{3} \cos \left (d x + c\right ) + {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{3} - {\left (2 \, a^{3} + 3 \, a b^{2} + {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{3 \, d} \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="fricas")
Output:
-1/3*(3*b^3*cos(d*x + c) + (3*a^2*b - b^3)*cos(d*x + c)^3 - (2*a^3 + 3*a*b ^2 + (a^3 - 3*a*b^2)*cos(d*x + c)^2)*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 117 vs. \(2 (48) = 96\).
Time = 0.13 (sec) , antiderivative size = 117, normalized size of antiderivative = 2.02 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\begin {cases} \frac {2 a^{3} \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {a^{3} \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac {a^{2} b \cos ^{3}{\left (c + d x \right )}}{d} + \frac {a b^{2} \sin ^{3}{\left (c + d x \right )}}{d} - \frac {b^{3} \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{d} - \frac {2 b^{3} \cos ^{3}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{3} & \text {otherwise} \end {cases} \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))**3,x)
Output:
Piecewise((2*a**3*sin(c + d*x)**3/(3*d) + a**3*sin(c + d*x)*cos(c + d*x)** 2/d - a**2*b*cos(c + d*x)**3/d + a*b**2*sin(c + d*x)**3/d - b**3*sin(c + d *x)**2*cos(c + d*x)/d - 2*b**3*cos(c + d*x)**3/(3*d), Ne(d, 0)), (x*(a*cos (c) + b*sin(c))**3, True))
Time = 0.03 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.45 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=-\frac {a^{2} b \cos \left (d x + c\right )^{3}}{d} + \frac {a b^{2} \sin \left (d x + c\right )^{3}}{d} - \frac {{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{3}}{3 \, d} + \frac {{\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} b^{3}}{3 \, d} \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="maxima")
Output:
-a^2*b*cos(d*x + c)^3/d + a*b^2*sin(d*x + c)^3/d - 1/3*(sin(d*x + c)^3 - 3 *sin(d*x + c))*a^3/d + 1/3*(cos(d*x + c)^3 - 3*cos(d*x + c))*b^3/d
Time = 0.13 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.57 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=-\frac {{\left (3 \, a^{2} b - b^{3}\right )} \cos \left (3 \, d x + 3 \, c\right )}{12 \, d} - \frac {3 \, {\left (a^{2} b + b^{3}\right )} \cos \left (d x + c\right )}{4 \, d} + \frac {{\left (a^{3} - 3 \, a b^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {3 \, {\left (a^{3} + a b^{2}\right )} \sin \left (d x + c\right )}{4 \, d} \] Input:
integrate((a*cos(d*x+c)+b*sin(d*x+c))^3,x, algorithm="giac")
Output:
-1/12*(3*a^2*b - b^3)*cos(3*d*x + 3*c)/d - 3/4*(a^2*b + b^3)*cos(d*x + c)/ d + 1/12*(a^3 - 3*a*b^2)*sin(3*d*x + 3*c)/d + 3/4*(a^3 + a*b^2)*sin(d*x + c)/d
Time = 15.58 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.79 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {\frac {\sin \left (c+d\,x\right )\,a^3\,{\cos \left (c+d\,x\right )}^2}{3}+\frac {2\,\sin \left (c+d\,x\right )\,a^3}{3}-a^2\,b\,{\cos \left (c+d\,x\right )}^3-\sin \left (c+d\,x\right )\,a\,b^2\,{\cos \left (c+d\,x\right )}^2+\sin \left (c+d\,x\right )\,a\,b^2+\frac {b^3\,{\cos \left (c+d\,x\right )}^3}{3}-b^3\,\cos \left (c+d\,x\right )}{d} \] Input:
int((a*cos(c + d*x) + b*sin(c + d*x))^3,x)
Output:
((2*a^3*sin(c + d*x))/3 - b^3*cos(c + d*x) + (b^3*cos(c + d*x)^3)/3 - a^2* b*cos(c + d*x)^3 + (a^3*cos(c + d*x)^2*sin(c + d*x))/3 + a*b^2*sin(c + d*x ) - a*b^2*cos(c + d*x)^2*sin(c + d*x))/d
Time = 0.17 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.69 \[ \int (a \cos (c+d x)+b \sin (c+d x))^3 \, dx=\frac {-3 \cos \left (d x +c \right )^{3} a^{2} b -2 \cos \left (d x +c \right )^{3} b^{3}+3 \cos \left (d x +c \right )^{2} \sin \left (d x +c \right ) a^{3}-3 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{2} b^{3}+2 \sin \left (d x +c \right )^{3} a^{3}+3 \sin \left (d x +c \right )^{3} a \,b^{2}}{3 d} \] Input:
int((a*cos(d*x+c)+b*sin(d*x+c))^3,x)
Output:
( - 3*cos(c + d*x)**3*a**2*b - 2*cos(c + d*x)**3*b**3 + 3*cos(c + d*x)**2* sin(c + d*x)*a**3 - 3*cos(c + d*x)*sin(c + d*x)**2*b**3 + 2*sin(c + d*x)** 3*a**3 + 3*sin(c + d*x)**3*a*b**2)/(3*d)