Solution
= Solution
Multiplying the master equation by $a_i$, summing over every state, and shifting indices in each gain term gives, for $2\leq i\leq m-1$,
$$
\boxed{\frac{dM_i}{dt}
=k_{i-1}^+M_{i-1}-(k_i^++k_i^-)M_i+k_{i+1}^-M_{i+1}.}
$$
At the absorbing left edge and reflecting right edge the corresponding equations are
$$
\boxed{\frac{dM_1}{dt}=-(k_1^++k_1^-)M_1+k_2^-M_2,}
$$
$$
\boxed{\frac{dM_m}{dt}=k_{m-1}^+M_{m-1}-k_m^-M_m.}
$$