Looking for a cleaner/quicker way to evaluate the integral of a quadratic Looking for a clean/quick way to evaluate
$$\int_{2-\sqrt{3}}^{2+\sqrt{3}}{ \left(x^2-4x+1\right)\textrm{d}x}=\left.\frac{x^3}{3}-2x^2+x \right|_{2-\sqrt{3}}^{2+\sqrt{3}}$$
So I evaluated all of this out leaving this expression as it was and there was some pretty nice cancelation that led me to the answer $-\sqrt{3}$. However, this was a question from a contest so I'm expecting that if we factor out the $x$ and then evaluate at the bounds there is something we can do to make the algebra nicer.
$$=\left.x(\frac{x^2}{3}-2x+1) \right|_{2-\sqrt{3}}^{2+\sqrt{3}}$$
Anyone see any quick way to do this? Thanks!
 A: Notice that $x^2 - 4x + 1 = (x - 2)^2 - 3$, so a substitution $y = x - 2$ yields
\begin{align*}
\int_{2-\sqrt{3}}^{2+\sqrt{3}} (x^2-4x+1)dx = \int_{-\sqrt{3}}^{\sqrt{3}}(y^2-3)dy = \left[\frac{y^3}{3} - 3y\right]_{-\sqrt{3}}^{\sqrt{3}} = 2\sqrt{3}-6\sqrt{3} = -4\sqrt{3}
\end{align*}
A: We're asked to integrate a polynomial function (fortunately of low degree) on an interval symmetric about $ \ x \ = \ X \ \ . \ $  Integrating a quadratic polynomial $ \ ax^2 + bx + c \ $ will produce
$$ \frac{a}{3} · [  \ (X + \Delta)^3 - (X - \Delta)^3 \ ] \ + \ \frac{b}{2} · [ \ (X + \Delta)^2 - (X - \Delta)^2 \ ] \ + \ c · [ \ (X + \Delta) - (X - \Delta) \ ] \ \ ,  $$
[with the differences "canceling" all the terms with even powers of $ \ \Delta  \ \ , \ $ including $ \ \Delta^0 \ \ ] $
$$ = \ \ \frac{a}{3} · 2 · (  \ 3X^2·\Delta \ + \ \Delta^3 \ ) \ + \ \frac{b}{2} · 2 ·  (2X · \Delta)  \ + \ c · 2 ·   \Delta   $$ $$ = \ \ \Delta  ·  \left[ \ 2aX^2 \ + \  \frac{2a}{3}·\Delta^2 \ + \  2bX \ + \ 2c \ \right] \ \ . $$
This is not a formula to memorize, but a "gimmick" to apply.  (Know your binomial coefficients when you need to go to powers higher than 2...)  For  $ \ \int_{2-\sqrt{3}}^{2+\sqrt{3}} \ { \left(x^2-4x+1\right) \ \textrm{d}x} \ \ , \ $ we have
$$ \sqrt3 ·  \left[ \ 2·1·2^2 \ + \  \frac{2·1}{3}·(\sqrt3)^2 \ + \  2·(-4)·2 \ + \ 2·1 \ \right]  $$
$$ = \ \ \sqrt3 ·  ( \ 8 \ + \  2 \ - \ 16 \ + \ 2 \ ) \ \ = \ \ -4·\sqrt3 \ \ .  $$
It probably helps with some of the methods proposed that this is a "contest-math" problem, so the numerical values permit something "slick".  (I can't remember the last time otherwise, though, that I saw completing the square on a quadratic place the vertex right in the center of the integration interval -- still, it's neat and I upvoted Tom Chen's answer.) Jyrki Lahtonen is using Archimedes' formula (A. was mighty proud of it), so that's something you ought to "store away in your head" for when you have an occasion to use it. (As for spotting that the integration is over the interval between the $ \ x-$intercepts of the parabola, I guess one would use the problem-solving "principle" of asking, "Why those numbers?" (for the integration limits), which is frequently helpful for contest-math and even course exam problems...)
