  In this work we analyze the inverse problem of recovering the space-dependent
potential coefficient in an elliptic / parabolic problem from distributed
observation. We establish novel (weighted) conditional stability estimates
under very mild conditions on the problem data. Then we provide an error
analysis of a standard reconstruction scheme based on the standard output
least-squares formulation with Tikhonov regularization (by an $H^1$-seminorm
penalty), which is then discretized by the Galerkin finite element method with
continuous piecewise linear finite elements in space (and also backward Euler
method in time for parabolic problems). We present a detailed analysis of the
discrete scheme, and provide convergence rates in a weighted $L^2(\Omega)$ for
discrete approximations with respect to the exact potential. The error bounds
are explicitly dependent on the noise level, regularization parameter and
discretization parameter(s). Under suitable conditions, we also derive error
estimates in the standard $L^2(\Omega)$ and interior $L^2$ norms. The analysis
employs sharp a priori error estimates and nonstandard test functions. Several
numerical experiments are given to complement the theoretical analysis.
