How to evaluate $\int_a^b(b-x)(x-a)dx$ in a smart way? It holds that $\int_a^b(b-x)(x-a)dx=1/6(b-a)^3$. I was wondering if there is a smart way of seeing this, instead of brute-force solving the intergral (it's not that tedious, but if there is a quick way about it, I would like to know it)
If it's not possible to do it smartly, then my other question would be how we go about factorizing the following expression:
$$
1/6(b^3-a^3+3a^2b-3ab^2).
$$
I mean, I know now that it equals $1/6(b-a)^3$, but what are the steps for factorizing this? Should we think of it as a polynomial in $a$ and $b$? Whenever I think of a factorization of a polynomial, I think of zeroes, but I'm not sure how that would work here.
 A: As an alternative, try the substitution $u=\frac{x-a}{b-a}$. This maps the interval of integration onto $[0, 1]$, and moves the dependence on $a$ and $b$ outside of the integral.
$$x=a+(b-a)u,\ \ \ dx=(b-a)du$$
$$I=\int_0^1[b-a-(b-a)u](b-a)u(b-a)du=(b-a)^3\int_0^1(1-u)u\ du$$
A: You may use the fact that for quadratic polynomials the Simpson $1-4-1$ rule is an exact quadrature formula. In particular
$$ \int_{a}^{b}(b-x)(x-a)\,dx = \frac{b-a}{6}\cdot 4\left(\frac{a-b}{2}\right)^2 =\frac{1}{6}(b-a)^3.$$
As an alternative, you may substitute $x=a+\lambda(b-a)$ and exploit
$$ \int_{0}^{1}\lambda(1-\lambda)\,d\lambda = B(2,2) = \frac{\Gamma(2)^2}{\Gamma(4)}=\frac{1}{6}.$$
In a elementary geometric fashion, the identity above is a consequence of the Archimedean quadrature of the parabolic segment.
A: Let $u=x-a$. Then $b-x=b-a-u$.
$$\int_a^b(b-x)(x-a)dx=\int_0^{b-a}[(b-a)u-u^2]du=\left[\frac{(b-a)u^2}{2}-\frac{u^3}{3}\right]_0^{b-a}$$
A: You can obviously reduce the range $[a,b]$ to $[0,1]$ by a linear change of variable, while pulling out a factor $(b-a)^3$.
Then, knowing that a parabolic arch occupies $2/3$ of its bounding rectangle, and $x(1-x)$ peaks at $1/4$,
$$\color{green}{\frac{(b-a)^3}6}.$$
A: Alternatively, note that the integrand is a quadratic function with vertex at $\frac{a+b}{2}$. So make the change:
$$t=x-\frac{a+b}{2}, -\int_a^b (x-a)(x-b)dx=-\int_{\frac{a-b}{2}}^{\frac{b-a}{2}} \left(t^2-\frac{(a-b)^2}{4}\right)dt=$$
$$\left(\frac{(a-b)^2t}{4}-\frac{t^3}{3}\right)\big{|}_{\frac{a-b}{2}}^{\frac{b-a}{2}}=\cdots=\frac{(b-a)^3}{6}.$$
