# Let $f(x)=\int_0^1|t-x|t~dt$ for all real $x$. Sketch the graph of $f(x)$, what is the minimum value of $f(x)$

Let $f(x)=\int_0^1|t-x|t~dt$ for all real $x$. Sketch the graph of $f(x)$, what is the minimum value of $f(x)$

I could not in any way understand how to approach this problem. I think I will be able to plot the graph if I know how the function looks like, so one can wish to avoid that part.

To find the minimum value I thought of differentiating the function. But, there is $x$ on one side and $t$ along with $x$ on the other side. I got really confuse how should I do that. Please help.

• You could try to evaluate the integral for some special values of $x$ to get some idea about how the function looks like Mar 9, 2014 at 9:43
• @user127.0.0.1 I could not understand what you meant.
– Hawk
Mar 9, 2014 at 9:46

Hint

• If $x\in [0,1]$ then $$f(x)=\int_0^x(x-t)tdt+\int_x^1(t-x)tdt$$
• If $x\ge1$ then $$f(x)=\int_0^1(x-t)tdt$$
• If $x\le0$ then $$f(x)=\int_0^1(t-x)tdt$$

so calculate these integrals and you find that $f$ is a polynomial on every interval.

• I guess you are correct and it was not so difficult as I assumed the question to be. Thank you for simplifying it.
– Hawk
Mar 9, 2014 at 9:49
• But, I have one more doubt. Will $x$ be treated as a constant in the integrals?
– Hawk
Mar 9, 2014 at 9:50
• You're welcome.
– user63181
Mar 9, 2014 at 9:50
• Yes treat $x$ as a constant.
– user63181
Mar 9, 2014 at 9:50
• Okay, thank you for the solution and thank you for the clarification.
– Hawk
Mar 9, 2014 at 9:56

If $x\ge 1$, then $|t-x|=x-t$ and $f(x) = \int_0^1t(x-t)dt = x/2-1/3$.

If $x\le 0$, then $|t-x|=t-x$ and $f(x)=\int_0^1t(t-x)dt = 1/3-x/2$.

If $x\in (0,1)$, then we split the integral in two: $$f(x)=\int_0^1t|t-x|dt =\int_0^xt|t-x|dt+\int_x^1t|t-x|dt$$ $$=\int_0^xt(x-t)dt+\int_x^1t(t-x)dt = x^3/2-x^3/3+(1-x^3)/3-x(1-x^2)/2$$$$=1/3-x/2+x^3/3.$$

Can you find the minimum value?