On the construction of analytic solutions for a diffusion-reaction equation with a discontinuous switch mechanism