  The modules of logarithmic derivations for the (extended) Catalan and Shi
arrangements associated with root systems are known to be free. However, except
for a few cases, explicit bases for such modules are not known. In this paper,
we construct explicit bases for type $A$ root systems. Our construction is
based on Bandlow-Musiker's integral formula for a basis of the space of
quasiinvariants. The integral formula can be considered as an expression for
the inverse of the primitive derivation introduced by K. Saito. We prove that
the discrete analogues of the integral formulas provide bases for Catalan and
Shi arrangements.
