\begin{equation} X\sim f(x)=K|x−1|,\quad |x−1|<3. \end{equation} Determine the value of $K$.
Here, $|x-1|<3 \Longleftrightarrow -2 < x < 4$.
The question I have is, when getting the integral for $f(x)$, we have to take as two parts (since we have an absolute value) \begin{equation} \int_{-2}^0 f(x)dx + \int_{0}^4 f(x)dx \end{equation}
or
\begin{equation} \int_{-2}^1 f(x)dx + \int_{1}^4 f(x)dx \end{equation}
which limit part is the correct one and why? please advise.
$$\begin{align}\int_{-2}^4|x-1|\,\mathrm dx&=\int_{-3}^3|y|\,\mathrm dy\\&=2\int_0^3y\,\mathrm dy\\&=9\end{align}$$ hence $K=\frac19.$