  Phosphorus (P) is one of the important elements for the formation of life and
plays a crucial role in several biochemical processes. Recent spectral line
surveys have confirmed the existence of P-bearing molecules, especially PN and
PO, in the star-formation regions, but their formation mechanisms are poorly
understood. The P-bearing molecule phosphorus nitride (PN) is detected in
several star-forming regions, but this molecule has been poorly studied at high
gas densities ($\geq$10$^{6}$ cm$^{-3}$) hot molecular cores. In this article,
we present the detection of the rotational emission line of PN with transition
J = 3$-$2 towards the hot molecular cores G10.47+0.03 and G31.41+0.31, using
the Atacama Compact Array (ACA). The estimated column densities of PN for
G10.47+0.03 and G31.41+0.31 using the local thermodynamic equilibrium (LTE)
model are (3.60$\pm$0.2)$\times$10$^{13}$ cm$^{-2}$ and
(9.10$\pm$0.1)$\times$10$^{12}$ cm$^{-2}$ with an excitation temperature of
150$\pm$25 K. The fractional abundance of PN relative to H$_{2}$ is
2.76$\times$10$^{-10}$ for G10.47+0.03 and 5.68$\times$10$^{-11}$ for
G31.41+0.031. We compute the two-phase warm-up chemical model of PN to
understand the chemical evolution in the environment of hot molecular cores.
After chemical modelling, we claim that PN is created in the gas phase via the
neutral-neutral reaction between PO and N in the warm-up stage. Similarly, PN
is destroyed via the ion-neutral reaction between H$_{3}$O$^{+}$ and PN.
