Integrand size = 18, antiderivative size = 61 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=\frac {1}{8} \left (8 a^2+b^2\right ) x-\frac {a b \cos (2 c+2 d x)}{2 d}-\frac {b^2 \cos (2 c+2 d x) \sin (2 c+2 d x)}{16 d} \] Output:
1/8*(8*a^2+b^2)*x-1/2*a*b*cos(2*d*x+2*c)/d-1/16*b^2*cos(2*d*x+2*c)*sin(2*d *x+2*c)/d
Time = 0.39 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.79 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=-\frac {-4 \left (8 a^2+b^2\right ) (c+d x)+16 a b \cos (2 (c+d x))+b^2 \sin (4 (c+d x))}{32 d} \] Input:
Integrate[(a + b*Cos[c + d*x]*Sin[c + d*x])^2,x]
Output:
-1/32*(-4*(8*a^2 + b^2)*(c + d*x) + 16*a*b*Cos[2*(c + d*x)] + b^2*Sin[4*(c + d*x)])/d
Time = 0.25 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {3042, 3145, 3042, 3123}
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+b \sin (c+d x) \cos (c+d x))^2 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a+b \sin (c+d x) \cos (c+d x))^2dx\) |
\(\Big \downarrow \) 3145 |
\(\displaystyle \int \left (a+\frac {1}{2} b \sin (2 c+2 d x)\right )^2dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+\frac {1}{2} b \sin (2 c+2 d x)\right )^2dx\) |
\(\Big \downarrow \) 3123 |
\(\displaystyle \frac {1}{8} x \left (8 a^2+b^2\right )-\frac {a b \cos (2 c+2 d x)}{2 d}-\frac {b^2 \sin (2 c+2 d x) \cos (2 c+2 d x)}{16 d}\) |
Input:
Int[(a + b*Cos[c + d*x]*Sin[c + d*x])^2,x]
Output:
((8*a^2 + b^2)*x)/8 - (a*b*Cos[2*c + 2*d*x])/(2*d) - (b^2*Cos[2*c + 2*d*x] *Sin[2*c + 2*d*x])/(16*d)
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(2*a^2 + b^ 2)*(x/2), x] + (-Simp[2*a*b*(Cos[c + d*x]/d), x] - Simp[b^2*Cos[c + d*x]*(S in[c + d*x]/(2*d)), x]) /; FreeQ[{a, b, c, d}, x]
Int[((a_) + cos[(c_.) + (d_.)*(x_)]*(b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_ Symbol] :> Int[(a + b*(Sin[2*c + 2*d*x]/2))^n, x] /; FreeQ[{a, b, c, d, n}, x]
Time = 0.77 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.75
method | result | size |
risch | \(a^{2} x +\frac {b^{2} x}{8}-\frac {b^{2} \sin \left (4 d x +4 c \right )}{32 d}-\frac {a b \cos \left (2 d x +2 c \right )}{2 d}\) | \(46\) |
parallelrisch | \(\frac {32 a^{2} d x +4 b^{2} d x -b^{2} \sin \left (4 d x +4 c \right )-16 a b \cos \left (2 d x +2 c \right )+16 a b}{32 d}\) | \(52\) |
parts | \(a^{2} x +\frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}+\frac {a b \sin \left (d x +c \right )^{2}}{d}\) | \(66\) |
derivativedivides | \(\frac {a^{2} \left (d x +c \right )-a b \cos \left (d x +c \right )^{2}+b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(69\) |
default | \(\frac {a^{2} \left (d x +c \right )-a b \cos \left (d x +c \right )^{2}+b^{2} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )^{3}}{4}+\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{8}+\frac {d x}{8}+\frac {c}{8}\right )}{d}\) | \(69\) |
norman | \(\frac {\left (a^{2}+\frac {b^{2}}{8}\right ) x +\left (a^{2}+\frac {b^{2}}{8}\right ) x \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{8}+\left (4 a^{2}+\frac {b^{2}}{2}\right ) x \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{2}+\left (4 a^{2}+\frac {b^{2}}{2}\right ) x \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{6}+\left (6 a^{2}+\frac {3 b^{2}}{4}\right ) x \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{4}-\frac {b^{2} \tan \left (\frac {c}{2}+\frac {d x}{2}\right )}{4 d}+\frac {7 b^{2} \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{3}}{4 d}-\frac {7 b^{2} \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{5}}{4 d}+\frac {b^{2} \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{7}}{4 d}+\frac {4 a b \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{2}}{d}+\frac {4 a b \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{6}}{d}+\frac {8 a b \tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{4}}{d}}{\left (1+\tan \left (\frac {c}{2}+\frac {d x}{2}\right )^{2}\right )^{4}}\) | \(251\) |
orering | \(x \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right )^{2}-\frac {5 \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) \left (-b d \sin \left (d x +c \right )^{2}+b \cos \left (d x +c \right )^{2} d \right )}{8 d^{2}}+\frac {5 x \left (2 \left (-b d \sin \left (d x +c \right )^{2}+b \cos \left (d x +c \right )^{2} d \right )^{2}-8 \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) b \,d^{2} \sin \left (d x +c \right ) \cos \left (d x +c \right )\right )}{16 d^{2}}-\frac {-24 \left (-b d \sin \left (d x +c \right )^{2}+b \cos \left (d x +c \right )^{2} d \right ) b \,d^{2} \sin \left (d x +c \right ) \cos \left (d x +c \right )-8 \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) b \,d^{3} \cos \left (d x +c \right )^{2}+8 \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) b \,d^{3} \sin \left (d x +c \right )^{2}}{64 d^{4}}+\frac {x \left (96 \sin \left (d x +c \right )^{2} \cos \left (d x +c \right )^{2} b^{2} d^{4}-32 \left (-b d \sin \left (d x +c \right )^{2}+b \cos \left (d x +c \right )^{2} d \right ) b \,d^{3} \cos \left (d x +c \right )^{2}+32 \left (-b d \sin \left (d x +c \right )^{2}+b \cos \left (d x +c \right )^{2} d \right ) b \,d^{3} \sin \left (d x +c \right )^{2}+32 \left (a +b \cos \left (d x +c \right ) \sin \left (d x +c \right )\right ) b \,d^{4} \cos \left (d x +c \right ) \sin \left (d x +c \right )\right )}{64 d^{4}}\) | \(385\) |
Input:
int((a+b*cos(d*x+c)*sin(d*x+c))^2,x,method=_RETURNVERBOSE)
Output:
a^2*x+1/8*b^2*x-1/32*b^2/d*sin(4*d*x+4*c)-1/2*a*b*cos(2*d*x+2*c)/d
Time = 0.07 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.03 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=-\frac {8 \, a b \cos \left (d x + c\right )^{2} - {\left (8 \, a^{2} + b^{2}\right )} d x + {\left (2 \, b^{2} \cos \left (d x + c\right )^{3} - b^{2} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{8 \, d} \] Input:
integrate((a+b*cos(d*x+c)*sin(d*x+c))^2,x, algorithm="fricas")
Output:
-1/8*(8*a*b*cos(d*x + c)^2 - (8*a^2 + b^2)*d*x + (2*b^2*cos(d*x + c)^3 - b ^2*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (53) = 106\).
Time = 0.20 (sec) , antiderivative size = 129, normalized size of antiderivative = 2.11 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=\begin {cases} a^{2} x + \frac {a b \sin ^{2}{\left (c + d x \right )}}{d} + \frac {b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} - \frac {b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} & \text {for}\: d \neq 0 \\x \left (a + b \sin {\left (c \right )} \cos {\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \] Input:
integrate((a+b*cos(d*x+c)*sin(d*x+c))**2,x)
Output:
Piecewise((a**2*x + a*b*sin(c + d*x)**2/d + b**2*x*sin(c + d*x)**4/8 + b** 2*x*sin(c + d*x)**2*cos(c + d*x)**2/4 + b**2*x*cos(c + d*x)**4/8 + b**2*si n(c + d*x)**3*cos(c + d*x)/(8*d) - b**2*sin(c + d*x)*cos(c + d*x)**3/(8*d) , Ne(d, 0)), (x*(a + b*sin(c)*cos(c))**2, True))
Time = 0.03 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.79 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=a^{2} x - \frac {a b \cos \left (d x + c\right )^{2}}{d} + \frac {{\left (4 \, d x + 4 \, c - \sin \left (4 \, d x + 4 \, c\right )\right )} b^{2}}{32 \, d} \] Input:
integrate((a+b*cos(d*x+c)*sin(d*x+c))^2,x, algorithm="maxima")
Output:
a^2*x - a*b*cos(d*x + c)^2/d + 1/32*(4*d*x + 4*c - sin(4*d*x + 4*c))*b^2/d
Time = 0.31 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.75 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=\frac {1}{8} \, {\left (8 \, a^{2} + b^{2}\right )} x - \frac {a b \cos \left (2 \, d x + 2 \, c\right )}{2 \, d} - \frac {b^{2} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} \] Input:
integrate((a+b*cos(d*x+c)*sin(d*x+c))^2,x, algorithm="giac")
Output:
1/8*(8*a^2 + b^2)*x - 1/2*a*b*cos(2*d*x + 2*c)/d - 1/32*b^2*sin(4*d*x + 4* c)/d
Time = 15.45 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.28 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=x\,\left (a^2+\frac {b^2}{8}\right )-\frac {-\frac {b^2\,{\mathrm {tan}\left (c+d\,x\right )}^3}{8}+\frac {b^2\,\mathrm {tan}\left (c+d\,x\right )}{8}+a\,b\,{\mathrm {tan}\left (c+d\,x\right )}^2+a\,b}{d\,\left ({\mathrm {tan}\left (c+d\,x\right )}^4+2\,{\mathrm {tan}\left (c+d\,x\right )}^2+1\right )} \] Input:
int((a + b*cos(c + d*x)*sin(c + d*x))^2,x)
Output:
x*(a^2 + b^2/8) - (a*b + (b^2*tan(c + d*x))/8 - (b^2*tan(c + d*x)^3)/8 + a *b*tan(c + d*x)^2)/(d*(2*tan(c + d*x)^2 + tan(c + d*x)^4 + 1))
Time = 0.15 (sec) , antiderivative size = 67, normalized size of antiderivative = 1.10 \[ \int (a+b \cos (c+d x) \sin (c+d x))^2 \, dx=\frac {2 \cos \left (d x +c \right ) \sin \left (d x +c \right )^{3} b^{2}-\cos \left (d x +c \right ) \sin \left (d x +c \right ) b^{2}+8 \sin \left (d x +c \right )^{2} a b +8 a^{2} d x +b^{2} d x}{8 d} \] Input:
int((a+b*cos(d*x+c)*sin(d*x+c))^2,x)
Output:
(2*cos(c + d*x)*sin(c + d*x)**3*b**2 - cos(c + d*x)*sin(c + d*x)*b**2 + 8* sin(c + d*x)**2*a*b + 8*a**2*d*x + b**2*d*x)/(8*d)