  Using a simple two-band model for Fe-based pnictides and the generalized
Eilenberger equation, we present a microscopic derivation of a time-dependent
equation for the amplitude of the spin density wave near the quantum critical
point where it turns to zero. This equation describes the dynamics of the
magnetic---$m$, as well as the superconducting order parameter---$\Delta$. It
is valid at low temperatures $T$ and small $m$ (${T, m \ll \Delta}$) in a
region of coexistence of both order parameters, $m$ and $\Delta$. The boundary
of this region is found in the space of the nesting parameter
$\{\mu_{0},\mu_{\phi}\}$ where $\mu_{0}$ describes the relative position of the
electron and the hole pockets on the energy scale, and $\mu_{\phi}$ accounts
for the ellipticity of the electron pocket. At low $T$ the number of
quasiparticles is small due to the presence of the energy gap $\Delta$, and
therefore the quasiparticles do not play a role in the relaxation of $m$. This
circumstance allows one to derive the time-dependent equation for $m$ in
contrast to the case of conventional superconductors for which the
time-dependent Ginzburg--Landau equation can be derived near $T_{\text{c}}$
only in some special cases (high concentration of paramagnetic impurities. In
the stationary case the derived equation is valid at arbitrary temperatures. We
find a solution of the stationary equation which describes a domain wall in the
magnetic structure. In the center of the domain wall the superconducting order
parameter has a maximum, which means a local enhancement of superconductivity.
Using the derived time-dependent equation for $m$, we investgate also the
stability of a uniform commensurate SDW and obtain the values of $\{\mu_{0},
\mu_{\phi}\}$ at which the first order transition into the state with ${m = 0}$
takes place or the transition to the state with an inhomogeneous SDW occurs.
