  We develop a systematic approach to compute physical observables of
integrable spin chains with finite length. Our method is based on Bethe ansatz
solution of the integrable spin chain and computational algebraic geometry. The
final results are analytic and no longer depend on Bethe roots. The computation
is purely algebraic and does not rely on further assumptions or numerics. This
method can be applied to compute a broad family of physical quantities in
integrable quantum spin chains. We demonstrate the power of the method by
computing two important quantities in quench dynamics: the diagonal entropy and
the Loschmidt echo and obtain new analytic results.
