\[ f(x)=\begin{cases} \frac{1}{b - a} & \mathrm{for}\ a \le x \le b, \\ 0 & \mathrm{for}\ x<a\ \mathrm{or}\ x>b \end{cases} \]