Task: Calculate probability based on depth $$f(x)=\begin{cases} \frac{1}{2} & x \in [1,3]\\\ 0 & x \not\in [1,3]\end{cases} $$
$$P([1,2])=?$$
My take on it: $$ \int_3^1 f(x)dx= [ \frac{x}{2} ]^{3}_{1} = \frac{3}{2} - \frac{1}{2} = 1$$
Is this correct?
That's not correct. You have to calculate $P(X \in [1,2]) = P(1 \leq X \leq 2) = \int_{1}^{2} f(x) \, dx = [x/2]_{1}^{2} = 1-1/2 = 1/2.$