Integrand size = 12, antiderivative size = 73 \[ \int x^2 \cos ^2(a+b x) \, dx=-\frac {x}{4 b^2}+\frac {x^3}{6}+\frac {x \cos ^2(a+b x)}{2 b^2}-\frac {\cos (a+b x) \sin (a+b x)}{4 b^3}+\frac {x^2 \cos (a+b x) \sin (a+b x)}{2 b} \] Output:
-1/4*x/b^2+1/6*x^3+1/2*x*cos(b*x+a)^2/b^2-1/4*cos(b*x+a)*sin(b*x+a)/b^3+1/ 2*x^2*cos(b*x+a)*sin(b*x+a)/b
Time = 0.08 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.64 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {4 b^3 x^3+6 b x \cos (2 (a+b x))+\left (-3+6 b^2 x^2\right ) \sin (2 (a+b x))}{24 b^3} \] Input:
Integrate[x^2*Cos[a + b*x]^2,x]
Output:
(4*b^3*x^3 + 6*b*x*Cos[2*(a + b*x)] + (-3 + 6*b^2*x^2)*Sin[2*(a + b*x)])/( 24*b^3)
Time = 0.25 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.07, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 3792, 15, 3042, 3115, 24}
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 x^2 \cos ^2(a+b x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int x^2 \sin \left (a+b x+\frac {\pi }{2}\right )^2dx\) |
\(\Big \downarrow \) 3792 |
\(\displaystyle -\frac {\int \cos ^2(a+b x)dx}{2 b^2}+\frac {\int x^2dx}{2}+\frac {x \cos ^2(a+b x)}{2 b^2}+\frac {x^2 \sin (a+b x) \cos (a+b x)}{2 b}\) |
\(\Big \downarrow \) 15 |
\(\displaystyle -\frac {\int \cos ^2(a+b x)dx}{2 b^2}+\frac {x \cos ^2(a+b x)}{2 b^2}+\frac {x^2 \sin (a+b x) \cos (a+b x)}{2 b}+\frac {x^3}{6}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {\int \sin \left (a+b x+\frac {\pi }{2}\right )^2dx}{2 b^2}+\frac {x \cos ^2(a+b x)}{2 b^2}+\frac {x^2 \sin (a+b x) \cos (a+b x)}{2 b}+\frac {x^3}{6}\) |
\(\Big \downarrow \) 3115 |
\(\displaystyle -\frac {\frac {\int 1dx}{2}+\frac {\sin (a+b x) \cos (a+b x)}{2 b}}{2 b^2}+\frac {x \cos ^2(a+b x)}{2 b^2}+\frac {x^2 \sin (a+b x) \cos (a+b x)}{2 b}+\frac {x^3}{6}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {x \cos ^2(a+b x)}{2 b^2}-\frac {\frac {\sin (a+b x) \cos (a+b x)}{2 b}+\frac {x}{2}}{2 b^2}+\frac {x^2 \sin (a+b x) \cos (a+b x)}{2 b}+\frac {x^3}{6}\) |
Input:
Int[x^2*Cos[a + b*x]^2,x]
Output:
x^3/6 + (x*Cos[a + b*x]^2)/(2*b^2) + (x^2*Cos[a + b*x]*Sin[a + b*x])/(2*b) - (x/2 + (Cos[a + b*x]*Sin[a + b*x])/(2*b))/(2*b^2)
Int[(a_.)*(x_)^(m_.), x_Symbol] :> Simp[a*(x^(m + 1)/(m + 1)), x] /; FreeQ[ {a, m}, x] && NeQ[m, -1]
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Sin[c + d*x])^(n - 1)/(d*n)), x] + Simp[b^2*((n - 1)/n) Int[(b*Sin [c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[ 2*n]
Int[((c_.) + (d_.)*(x_))^(m_)*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbo l] :> Simp[d*m*(c + d*x)^(m - 1)*((b*Sin[e + f*x])^n/(f^2*n^2)), x] + (-Sim p[b*(c + d*x)^m*Cos[e + f*x]*((b*Sin[e + f*x])^(n - 1)/(f*n)), x] + Simp[b^ 2*((n - 1)/n) Int[(c + d*x)^m*(b*Sin[e + f*x])^(n - 2), x], x] - Simp[d^2 *m*((m - 1)/(f^2*n^2)) Int[(c + d*x)^(m - 2)*(b*Sin[e + f*x])^n, x], x]) /; FreeQ[{b, c, d, e, f}, x] && GtQ[n, 1] && GtQ[m, 1]
Time = 0.41 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.63
method | result | size |
risch | \(\frac {x^{3}}{6}+\frac {x \cos \left (2 b x +2 a \right )}{4 b^{2}}+\frac {\left (2 b^{2} x^{2}-1\right ) \sin \left (2 b x +2 a \right )}{8 b^{3}}\) | \(46\) |
parallelrisch | \(\frac {\left (6 b^{2} x^{2}-3\right ) \sin \left (2 b x +2 a \right )+4 x^{3} b^{3}+6 x \cos \left (2 b x +2 a \right ) b}{24 b^{3}}\) | \(48\) |
derivativedivides | \(\frac {a^{2} \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-2 a \left (\left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-\frac {\left (b x +a \right )^{2}}{4}-\frac {\sin \left (b x +a \right )^{2}}{4}\right )+\left (b x +a \right )^{2} \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )+\frac {\left (b x +a \right ) \cos \left (b x +a \right )^{2}}{2}-\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{4}-\frac {b x}{4}-\frac {a}{4}-\frac {\left (b x +a \right )^{3}}{3}}{b^{3}}\) | \(158\) |
default | \(\frac {a^{2} \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-2 a \left (\left (b x +a \right ) \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )-\frac {\left (b x +a \right )^{2}}{4}-\frac {\sin \left (b x +a \right )^{2}}{4}\right )+\left (b x +a \right )^{2} \left (\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{2}+\frac {b x}{2}+\frac {a}{2}\right )+\frac {\left (b x +a \right ) \cos \left (b x +a \right )^{2}}{2}-\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{4}-\frac {b x}{4}-\frac {a}{4}-\frac {\left (b x +a \right )^{3}}{3}}{b^{3}}\) | \(158\) |
norman | \(\frac {\frac {x^{2} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{b}+\frac {x^{3}}{6}-\frac {\tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{2 b^{3}}+\frac {\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{3}}{2 b^{3}}+\frac {x}{4 b^{2}}+\frac {x^{3} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}}{3}+\frac {x^{3} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4}}{6}-\frac {3 x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}}{2 b^{2}}+\frac {x \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{4}}{4 b^{2}}-\frac {x^{2} \tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{3}}{b}}{\left (1+\tan \left (\frac {b x}{2}+\frac {a}{2}\right )^{2}\right )^{2}}\) | \(160\) |
orering | \(\frac {\left (x^{4} b^{4}+3 b^{2} x^{2}-3\right ) \cos \left (b x +a \right )^{2}}{3 x \,b^{4}}-\frac {\left (14 b^{2} x^{2}-15\right ) \left (2 x \cos \left (b x +a \right )^{2}-2 x^{2} \sin \left (b x +a \right ) b \cos \left (b x +a \right )\right )}{24 x^{2} b^{4}}+\frac {\left (2 b^{2} x^{2}-3\right ) \left (2 \cos \left (b x +a \right )^{2}-8 x \sin \left (b x +a \right ) b \cos \left (b x +a \right )-2 x^{2} b^{2} \cos \left (b x +a \right )^{2}+2 x^{2} \sin \left (b x +a \right )^{2} b^{2}\right )}{24 x \,b^{4}}\) | \(160\) |
Input:
int(x^2*cos(b*x+a)^2,x,method=_RETURNVERBOSE)
Output:
1/6*x^3+1/4/b^2*x*cos(2*b*x+2*a)+1/8*(2*b^2*x^2-1)/b^3*sin(2*b*x+2*a)
Time = 0.09 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.74 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {2 \, b^{3} x^{3} + 6 \, b x \cos \left (b x + a\right )^{2} + 3 \, {\left (2 \, b^{2} x^{2} - 1\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) - 3 \, b x}{12 \, b^{3}} \] Input:
integrate(x^2*cos(b*x+a)^2,x, algorithm="fricas")
Output:
1/12*(2*b^3*x^3 + 6*b*x*cos(b*x + a)^2 + 3*(2*b^2*x^2 - 1)*cos(b*x + a)*si n(b*x + a) - 3*b*x)/b^3
Time = 0.24 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.44 \[ \int x^2 \cos ^2(a+b x) \, dx=\begin {cases} \frac {x^{3} \sin ^{2}{\left (a + b x \right )}}{6} + \frac {x^{3} \cos ^{2}{\left (a + b x \right )}}{6} + \frac {x^{2} \sin {\left (a + b x \right )} \cos {\left (a + b x \right )}}{2 b} - \frac {x \sin ^{2}{\left (a + b x \right )}}{4 b^{2}} + \frac {x \cos ^{2}{\left (a + b x \right )}}{4 b^{2}} - \frac {\sin {\left (a + b x \right )} \cos {\left (a + b x \right )}}{4 b^{3}} & \text {for}\: b \neq 0 \\\frac {x^{3} \cos ^{2}{\left (a \right )}}{3} & \text {otherwise} \end {cases} \] Input:
integrate(x**2*cos(b*x+a)**2,x)
Output:
Piecewise((x**3*sin(a + b*x)**2/6 + x**3*cos(a + b*x)**2/6 + x**2*sin(a + b*x)*cos(a + b*x)/(2*b) - x*sin(a + b*x)**2/(4*b**2) + x*cos(a + b*x)**2/( 4*b**2) - sin(a + b*x)*cos(a + b*x)/(4*b**3), Ne(b, 0)), (x**3*cos(a)**2/3 , True))
Time = 0.03 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.55 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {4 \, {\left (b x + a\right )}^{3} + 6 \, {\left (2 \, b x + 2 \, a + \sin \left (2 \, b x + 2 \, a\right )\right )} a^{2} - 6 \, {\left (2 \, {\left (b x + a\right )}^{2} + 2 \, {\left (b x + a\right )} \sin \left (2 \, b x + 2 \, a\right ) + \cos \left (2 \, b x + 2 \, a\right )\right )} a + 6 \, {\left (b x + a\right )} \cos \left (2 \, b x + 2 \, a\right ) + 3 \, {\left (2 \, {\left (b x + a\right )}^{2} - 1\right )} \sin \left (2 \, b x + 2 \, a\right )}{24 \, b^{3}} \] Input:
integrate(x^2*cos(b*x+a)^2,x, algorithm="maxima")
Output:
1/24*(4*(b*x + a)^3 + 6*(2*b*x + 2*a + sin(2*b*x + 2*a))*a^2 - 6*(2*(b*x + a)^2 + 2*(b*x + a)*sin(2*b*x + 2*a) + cos(2*b*x + 2*a))*a + 6*(b*x + a)*c os(2*b*x + 2*a) + 3*(2*(b*x + a)^2 - 1)*sin(2*b*x + 2*a))/b^3
Time = 0.12 (sec) , antiderivative size = 45, normalized size of antiderivative = 0.62 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {1}{6} \, x^{3} + \frac {x \cos \left (2 \, b x + 2 \, a\right )}{4 \, b^{2}} + \frac {{\left (2 \, b^{2} x^{2} - 1\right )} \sin \left (2 \, b x + 2 \, a\right )}{8 \, b^{3}} \] Input:
integrate(x^2*cos(b*x+a)^2,x, algorithm="giac")
Output:
1/6*x^3 + 1/4*x*cos(2*b*x + 2*a)/b^2 + 1/8*(2*b^2*x^2 - 1)*sin(2*b*x + 2*a )/b^3
Time = 0.12 (sec) , antiderivative size = 52, normalized size of antiderivative = 0.71 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {x^3}{6}-\frac {\sin \left (2\,a+2\,b\,x\right )}{8\,b^3}+\frac {x\,\cos \left (2\,a+2\,b\,x\right )}{4\,b^2}+\frac {x^2\,\sin \left (2\,a+2\,b\,x\right )}{4\,b} \] Input:
int(x^2*cos(a + b*x)^2,x)
Output:
x^3/6 - sin(2*a + 2*b*x)/(8*b^3) + (x*cos(2*a + 2*b*x))/(4*b^2) + (x^2*sin (2*a + 2*b*x))/(4*b)
Time = 0.16 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.88 \[ \int x^2 \cos ^2(a+b x) \, dx=\frac {6 \cos \left (b x +a \right ) \sin \left (b x +a \right ) b^{2} x^{2}-3 \cos \left (b x +a \right ) \sin \left (b x +a \right )-6 \sin \left (b x +a \right )^{2} b x +2 b^{3} x^{3}+3 b x}{12 b^{3}} \] Input:
int(x^2*cos(b*x+a)^2,x)
Output:
(6*cos(a + b*x)*sin(a + b*x)*b**2*x**2 - 3*cos(a + b*x)*sin(a + b*x) - 6*s in(a + b*x)**2*b*x + 2*b**3*x**3 + 3*b*x)/(12*b**3)