Solution
= Solution
There are two disjoint ways to make an error: an individual from class one falls outside $R_1$, or an individual from class two falls inside $R_1$. The <law of total probability> gives
$$
\boxed{P_{\mathrm{error}}=
\pi_1\int_{R_1^c}f_1(x)\,dx+(1-\pi_1)\int_{R_1}f_2(x)\,dx.}
$$
Since $f_1$ integrates to one, this also equals
$$
\pi_1+\int_{R_1}\bigl((1-\pi_1)f_2(x)-\pi_1f_1(x)\bigr)\,dx.
$$
This form isolates the only term changed by choosing the decision region.