On a Poisson's equation arising from magnetism