Why this limit of integration? I've been solving problems from the book by DeGroot and Schervish and I can't understand why m is the upper limit of integration in the solution to this problem. Why not the lower one?
Here is the problem: 
Suppose that a random variable X has a continuous distribution for which the p.d.f. f is as follows:
$f(x) = 2x$ for $ 0< x <1, 0 $ otherwise
Determine the value of $d$ that minimizes $E(|X − d|)$.
Here is the solution:
$$ \int_0^m 2x \, dx=0.5  $$
Thank you very much in advance.

I will note one important thing about the question. You will get $$E^{'}[X]=1-2d^2$$ as @nbubis wrote down already. When you find $$E^{''}[X]=-4d$$ and since $d\in[0,1]$ you have $$E^{''}[X]<0$$ which indicates that you have a maximum instead of minimum as you stated in the question
EDIT: Result was based on $$E^{'}[X]=1-2d^2$$ Since it is $$E^{'}[X]=2d^2-1,$$ there is a minimum. I didnt solve the first derivative by myself just copied.
