  We consider a numerical method to solve the local cohomology problem related
to the gauge anomaly cancellation in U(1) chiral gauge theories. In the
cohomological analysis of the chiral anomaly, it is required to carry out the
differentiation and the integration of the anomaly with respect to the
continuous parameter for the interpolation of the admissible gauge fields. In
our numerical approach, the differentiation is evaluated explicitly through the
rational approximation of the overlap Dirac operator with Zolotarev
optimization. The integration is performed with a Gaussian Quadrature formula,
which turns out to show rather good convergence. The Poincare lemma is
reformulated for the finite lattice and is implemented numerically. We compute
the current associated with the cohomologically trivial part of the chiral
anomaly in two-dimensions and check its locality properties.
