Optimal. Leaf size=30 \[ \frac {x}{2}+\frac {x^3}{3}-2 x \cos (x)+2 \sin (x)-\frac {1}{2} \cos (x) \sin (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.02, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {6874, 3377,
2717, 2715, 8} \begin {gather*} \frac {x^3}{3}+\frac {x}{2}+2 \sin (x)-2 x \cos (x)-\frac {1}{2} \sin (x) \cos (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 2717
Rule 3377
Rule 6874
Rubi steps
\begin {align*} \int (x+\sin (x))^2 \, dx &=\int \left (x^2+2 x \sin (x)+\sin ^2(x)\right ) \, dx\\ &=\frac {x^3}{3}+2 \int x \sin (x) \, dx+\int \sin ^2(x) \, dx\\ &=\frac {x^3}{3}-2 x \cos (x)-\frac {1}{2} \cos (x) \sin (x)+\frac {\int 1 \, dx}{2}+2 \int \cos (x) \, dx\\ &=\frac {x}{2}+\frac {x^3}{3}-2 x \cos (x)+2 \sin (x)-\frac {1}{2} \cos (x) \sin (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 30, normalized size = 1.00 \begin {gather*} \frac {1}{6} x \left (3+2 x^2\right )-2 x \cos (x)+2 \sin (x)-\frac {1}{4} \sin (2 x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [A]
time = 1.96, size = 24, normalized size = 0.80 \begin {gather*} -2 x \text {Cos}\left [x\right ]+\frac {x}{2}+\frac {x^3}{3}-\frac {\text {Sin}\left [2 x\right ]}{4}+2 \text {Sin}\left [x\right ] \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.03, size = 25, normalized size = 0.83
method | result | size |
default | \(\frac {x}{2}+\frac {x^{3}}{3}-2 x \cos \left (x \right )+2 \sin \left (x \right )-\frac {\cos \left (x \right ) \sin \left (x \right )}{2}\) | \(25\) |
risch | \(\frac {x^{3}}{3}+\frac {x}{2}-2 x \cos \left (x \right )+2 \sin \left (x \right )-\frac {\sin \left (2 x \right )}{4}\) | \(25\) |
norman | \(\frac {x \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-\frac {3 x}{2}+\frac {x^{3}}{3}+5 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+\frac {5 x \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{2}+\frac {2 x^{3} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{3}+\frac {x^{3} \left (\tan ^{4}\left (\frac {x}{2}\right )\right )}{3}+3 \tan \left (\frac {x}{2}\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )^{2}}\) | \(74\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 24, normalized size = 0.80 \begin {gather*} \frac {1}{3} \, x^{3} - 2 \, x \cos \left (x\right ) + \frac {1}{2} \, x - \frac {1}{4} \, \sin \left (2 \, x\right ) + 2 \, \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 22, normalized size = 0.73 \begin {gather*} \frac {1}{3} \, x^{3} - 2 \, x \cos \left (x\right ) - \frac {1}{2} \, {\left (\cos \left (x\right ) - 4\right )} \sin \left (x\right ) + \frac {1}{2} \, x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.08, size = 41, normalized size = 1.37 \begin {gather*} \frac {x^{3}}{3} + \frac {x \sin ^{2}{\left (x \right )}}{2} + \frac {x \cos ^{2}{\left (x \right )}}{2} - 2 x \cos {\left (x \right )} - \frac {\sin {\left (x \right )} \cos {\left (x \right )}}{2} + 2 \sin {\left (x \right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.00, size = 31, normalized size = 1.03 \begin {gather*} -2 x \cos x+2 \sin x+\frac {\frac {2}{3} x^{3}+x}{2}-\frac {\sin \left (2 x\right )}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.31, size = 24, normalized size = 0.80 \begin {gather*} \frac {x}{2}+2\,\sin \left (x\right )-\frac {\cos \left (x\right )\,\sin \left (x\right )}{2}-2\,x\,\cos \left (x\right )+\frac {x^3}{3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________