TITLE: Finding $\min f(x)$ where $f(x)=\int_0^1 |t-x|t\,dt \quad \forall x \in \mathbb{R}$
QUESTION [5 upvotes]: Can I write the integral as $f(x)=\int_0^{x} |t-x|t\,dt + \int_{x}^1  |t-x|t\,dt$ 
so that $f(x)=\frac{2x^3-x}{2}+\frac{1-2x^3}{3}$
But here I'm restricting $x$ to the interval $(0,1)$ and I need $x$ to be any real number. 
So what should be the correct approach here to find the minimum value of $f$?

REPLY [4 votes]: If $x \le 0$ then $|t-x| = t-x$ for all $t \in [0,1]$ so that $$\int_0^1 |t-x|t \, dt = \int_0^1 (t-x)t \, dt = \frac 13 - \frac x2$$ which has its minimum value of $\dfrac 13$ at $x=0$.
Likewise, if $x \ge 1$ then $|t-x| = x-t$ for all $t \in [0,1]$ and the minimum can be worked out accordingly.