  The chemical differentiation of seven COMs in the extended region around Sgr
B2 has been observed: CH$_2$OHCHO, CH$_3$OCHO, t-HCOOH, C$_2$H$_5$OH, and
CH$_3$NH$_2$ were detected both in the extended region and near the hot cores
Sgr B2(N) and Sgr B2(M), while CH$_3$OCH$_3$ and C$_2$H$_5$CN were only
detected near the hot cores. The density and temperature in the extended region
are relatively low. Different desorption mechanisms have been proposed to
explain the observed COMs in cold regions but fail to explain the deficiency of
CH$_3$OCH$_3$ and C$_2$H$_5$CN. We explored under what physical conditions the
chemical simulations can fit the observations and explain the different spatial
distribution of these species. We used the Monte Carlo method to perform a
detailed parameter space study. We investigated how different mechanisms affect
the results. All gas-grain chemical models based on static physics cannot fit
the observations. The results based on evolving physical conditions can fit six
COMs when $T\sim30-60$ K, but the best-fit temperature is still higher than the
observed dust temperature of 20 K. The best agreement at $T\sim27$ K is
achieved by considering a short-duration $\sim 10^2$ yr X-ray burst with
$\zeta_{\mathrm{CR}}=1.3\times10^{-13}$ s$^{-1}$ when the temperature is 20 K.
The reactive desorption is the key mechanism for producing these COMs and
inducing the low abundances of CH$_3$OCH$_3$ and C$_2$H$_5$CN. The evolution of
the extended region around Sgr~B2 may have begun with a cold, $T\le10$ K phase
followed by a warm-up phase. When its temperature reached $T\sim20$ K, an X-ray
flare from Sgr A* with a short duration of no more than 100 years was acquired,
affecting strongly the Sgr B2 chemistry. The observed COMs retain their
observed abundances only several hundred years after such a flare, which could
imply that such short-term X-ray flares occur relatively often.
