Optimal. Leaf size=53 \[ 2 x^2 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a}+8 x \sqrt {a \cos (x)+a}-16 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3319, 3296, 2637} \[ 2 x^2 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a}+8 x \sqrt {a \cos (x)+a}-16 \tan \left (\frac {x}{2}\right ) \sqrt {a \cos (x)+a} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2637
Rule 3296
Rule 3319
Rubi steps
\begin {align*} \int x^2 \sqrt {a+a \cos (x)} \, dx &=\left (\sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int x^2 \cos \left (\frac {x}{2}\right ) \, dx\\ &=2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )-\left (4 \sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int x \sin \left (\frac {x}{2}\right ) \, dx\\ &=8 x \sqrt {a+a \cos (x)}+2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )-\left (8 \sqrt {a+a \cos (x)} \sec \left (\frac {x}{2}\right )\right ) \int \cos \left (\frac {x}{2}\right ) \, dx\\ &=8 x \sqrt {a+a \cos (x)}-16 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )+2 x^2 \sqrt {a+a \cos (x)} \tan \left (\frac {x}{2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 29, normalized size = 0.55 \[ 8 \left (\frac {1}{4} \left (x^2-8\right ) \tan \left (\frac {x}{2}\right )+x\right ) \sqrt {a (\cos (x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.42, size = 43, normalized size = 0.81 \[ 2 \, \sqrt {2} {\left (4 \, x \cos \left (\frac {1}{2} \, x\right ) \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right ) + {\left (x^{2} \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right ) - 8 \, \mathrm {sgn}\left (\cos \left (\frac {1}{2} \, x\right )\right )\right )} \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.07, size = 70, normalized size = 1.32 \[ -\frac {i \sqrt {2}\, \sqrt {a \left ({\mathrm e}^{i x}+1\right )^{2} {\mathrm e}^{-i x}}\, \left (4 i x \,{\mathrm e}^{i x}+x^{2} {\mathrm e}^{i x}+4 i x -x^{2}-8 \,{\mathrm e}^{i x}+8\right )}{{\mathrm e}^{i x}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 1.29, size = 36, normalized size = 0.68 \[ 2 \, {\left (\sqrt {2} x^{2} \sin \left (\frac {1}{2} \, x\right ) + 4 \, \sqrt {2} x \cos \left (\frac {1}{2} \, x\right ) - 8 \, \sqrt {2} \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.34, size = 70, normalized size = 1.32 \[ \frac {2\,\sqrt {a}\,\sqrt {\cos \relax (x)+1}\,\left (x^2\,\cos \relax (x)-8\,\cos \relax (x)-4\,x\,\sin \relax (x)-x^2+8+x\,4{}\mathrm {i}-\sin \relax (x)\,8{}\mathrm {i}+x^2\,\sin \relax (x)\,1{}\mathrm {i}+x\,\cos \relax (x)\,4{}\mathrm {i}\right )}{\cos \relax (x)\,1{}\mathrm {i}-\sin \relax (x)+1{}\mathrm {i}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \sqrt {a \left (\cos {\relax (x )} + 1\right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________