Optimal. Leaf size=73 \[ \frac{\sin (a+b x) \cos (a+b x)}{4 b^3}+\frac{x \sin ^2(a+b x)}{2 b^2}-\frac{x^2 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{x}{4 b^2}+\frac{x^3}{6} \]
[Out]
_______________________________________________________________________________________
Rubi [A] time = 0.077704, antiderivative size = 73, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333 \[ \frac{\sin (a+b x) \cos (a+b x)}{4 b^3}+\frac{x \sin ^2(a+b x)}{2 b^2}-\frac{x^2 \sin (a+b x) \cos (a+b x)}{2 b}-\frac{x}{4 b^2}+\frac{x^3}{6} \]
Antiderivative was successfully verified.
[In] Int[x^2*Sin[a + b*x]^2,x]
[Out]
_______________________________________________________________________________________
Rubi in Sympy [A] time = 2.62825, size = 65, normalized size = 0.89 \[ \frac{x^{3}}{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 )}}{2 b^{2}} - \frac{x}{4 b^{2}} + \frac{\sin{\left (a + b x \right )} \cos{\left (a + b x \right )}}{4 b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] rubi_integrate(x**2*sin(b*x+a)**2,x)
[Out]
_______________________________________________________________________________________
Mathematica [A] time = 0.133366, size = 47, normalized size = 0.64 \[ \frac{\left (3-6 b^2 x^2\right ) \sin (2 (a+b x))-6 b x \cos (2 (a+b x))+4 b^3 x^3}{24 b^3} \]
Antiderivative was successfully verified.
[In] Integrate[x^2*Sin[a + b*x]^2,x]
[Out]
_______________________________________________________________________________________
Maple [B] time = 0.004, size = 158, normalized size = 2.2 \[{\frac{1}{{b}^{3}} \left ( \left ( bx+a \right ) ^{2} \left ( -{\frac{\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{2}}+{\frac{bx}{2}}+{\frac{a}{2}} \right ) -{\frac{ \left ( bx+a \right ) \left ( \cos \left ( bx+a \right ) \right ) ^{2}}{2}}+{\frac{\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{4}}+{\frac{bx}{4}}+{\frac{a}{4}}-{\frac{ \left ( bx+a \right ) ^{3}}{3}}-2\,a \left ( \left ( bx+a \right ) \left ( -1/2\,\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) +1/2\,bx+a/2 \right ) -1/4\, \left ( bx+a \right ) ^{2}+1/4\, \left ( \sin \left ( bx+a \right ) \right ) ^{2} \right ) +{a}^{2} \left ( -{\frac{\cos \left ( bx+a \right ) \sin \left ( bx+a \right ) }{2}}+{\frac{bx}{2}}+{\frac{a}{2}} \right ) \right ) } \]
Verification of antiderivative is not currently implemented for this CAS.
[In] int(x^2*sin(b*x+a)^2,x)
[Out]
_______________________________________________________________________________________
Maxima [A] time = 1.40111, size = 158, normalized size = 2.16 \[ \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}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(x^2*sin(b*x + a)^2,x, algorithm="maxima")
[Out]
_______________________________________________________________________________________
Fricas [A] time = 0.240634, size = 73, normalized size = 1. \[ \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}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(x^2*sin(b*x + a)^2,x, algorithm="fricas")
[Out]
_______________________________________________________________________________________
Sympy [A] time = 1.52803, size = 105, normalized size = 1.44 \[ \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} \sin ^{2}{\left (a \right )}}{3} & \text{otherwise} \end{cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(x**2*sin(b*x+a)**2,x)
[Out]
_______________________________________________________________________________________
GIAC/XCAS [A] time = 0.199986, size = 61, normalized size = 0.84 \[ \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}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In] integrate(x^2*sin(b*x + a)^2,x, algorithm="giac")
[Out]