POTENTIAL THEORY IN GRAVITY AND MAGNETIC APPLICATIONS