Optimal. Leaf size=40 \[ \frac {7}{4} \cos (2 x)-2 x \cos (2 x)-\frac {1}{2} x^2 \cos (2 x)+\sin (2 x)+\frac {1}{2} x \sin (2 x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {6874, 2718,
3377, 2717} \begin {gather*} -\frac {1}{2} x^2 \cos (2 x)+\frac {1}{2} x \sin (2 x)+\sin (2 x)-2 x \cos (2 x)+\frac {7}{4} \cos (2 x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 2718
Rule 3377
Rule 6874
Rubi steps
\begin {align*} \int \left (-3+4 x+x^2\right ) \sin (2 x) \, dx &=\int \left (-3 \sin (2 x)+4 x \sin (2 x)+x^2 \sin (2 x)\right ) \, dx\\ &=-(3 \int \sin (2 x) \, dx)+4 \int x \sin (2 x) \, dx+\int x^2 \sin (2 x) \, dx\\ &=\frac {3}{2} \cos (2 x)-2 x \cos (2 x)-\frac {1}{2} x^2 \cos (2 x)+2 \int \cos (2 x) \, dx+\int x \cos (2 x) \, dx\\ &=\frac {3}{2} \cos (2 x)-2 x \cos (2 x)-\frac {1}{2} x^2 \cos (2 x)+\sin (2 x)+\frac {1}{2} x \sin (2 x)-\frac {1}{2} \int \sin (2 x) \, dx\\ &=\frac {7}{4} \cos (2 x)-2 x \cos (2 x)-\frac {1}{2} x^2 \cos (2 x)+\sin (2 x)+\frac {1}{2} x \sin (2 x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 29, normalized size = 0.72 \begin {gather*} \frac {1}{4} \left (\left (7-8 x-2 x^2\right ) \cos (2 x)+2 (2+x) \sin (2 x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 35, normalized size = 0.88
method | result | size |
risch | \(\left (-\frac {1}{2} x^{2}-2 x +\frac {7}{4}\right ) \cos \left (2 x \right )+\frac {\left (2+x \right ) \sin \left (2 x \right )}{2}\) | \(26\) |
derivativedivides | \(\frac {7 \cos \left (2 x \right )}{4}-2 x \cos \left (2 x \right )-\frac {x^{2} \cos \left (2 x \right )}{2}+\sin \left (2 x \right )+\frac {x \sin \left (2 x \right )}{2}\) | \(35\) |
default | \(\frac {7 \cos \left (2 x \right )}{4}-2 x \cos \left (2 x \right )-\frac {x^{2} \cos \left (2 x \right )}{2}+\sin \left (2 x \right )+\frac {x \sin \left (2 x \right )}{2}\) | \(35\) |
norman | \(\frac {x \tan \left (x \right )-2 x -\frac {x^{2}}{2}+2 x \left (\tan ^{2}\left (x \right )\right )+\frac {x^{2} \left (\tan ^{2}\left (x \right )\right )}{2}+2 \tan \left (x \right )+\frac {7}{2}}{1+\tan ^{2}\left (x \right )}\) | \(44\) |
meijerg | \(\frac {\sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (-2 x^{2}+1\right ) \cos \left (2 x \right )}{2 \sqrt {\pi }}+\frac {x \sin \left (2 x \right )}{\sqrt {\pi }}\right )}{2}+2 \sqrt {\pi }\, \left (-\frac {x \cos \left (2 x \right )}{\sqrt {\pi }}+\frac {\sin \left (2 x \right )}{2 \sqrt {\pi }}\right )-\frac {3 \sqrt {\pi }\, \left (\frac {1}{\sqrt {\pi }}-\frac {\cos \left (2 x \right )}{\sqrt {\pi }}\right )}{2}\) | \(81\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 2.12, size = 38, normalized size = 0.95 \begin {gather*} -\frac {1}{4} \, {\left (2 \, x^{2} - 1\right )} \cos \left (2 \, x\right ) - 2 \, x \cos \left (2 \, x\right ) + \frac {1}{2} \, x \sin \left (2 \, x\right ) + \frac {3}{2} \, \cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.59, size = 26, normalized size = 0.65 \begin {gather*} -\frac {1}{4} \, {\left (2 \, x^{2} + 8 \, x - 7\right )} \cos \left (2 \, x\right ) + \frac {1}{2} \, {\left (x + 2\right )} \sin \left (2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.09, size = 39, normalized size = 0.98 \begin {gather*} - \frac {x^{2} \cos {\left (2 x \right )}}{2} + \frac {x \sin {\left (2 x \right )}}{2} - 2 x \cos {\left (2 x \right )} + \sin {\left (2 x \right )} + \frac {7 \cos {\left (2 x \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.15, size = 26, normalized size = 0.65 \begin {gather*} -\frac {1}{4} \, {\left (2 \, x^{2} + 8 \, x - 7\right )} \cos \left (2 \, x\right ) + \frac {1}{2} \, {\left (x + 2\right )} \sin \left (2 \, x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.20, size = 34, normalized size = 0.85 \begin {gather*} \frac {7\,\cos \left (2\,x\right )}{4}+\sin \left (2\,x\right )-2\,x\,\cos \left (2\,x\right )+\frac {x\,\sin \left (2\,x\right )}{2}-\frac {x^2\,\cos \left (2\,x\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________