The potential of a unit sliver “pseudo” simplex. A sliver is a tetrahedron with three long edges and three short edges. The long edges all meet at (0, 0, 0). Integrate[x^2/Sqrt[(x - w)^2 + y^2], x] == ((3*w + x)*(w^2 - 2*w*x + x^2 + y^2) + (2*w^2 - y^2)*Sqrt[w^2 - 2*w*x + x^2 + y^2]* Log[2*(-w + x + Sqrt[w^2 - 2*w*x + x^2 + y^2])])/ (2*Sqrt[w^2 - 2*w*x + x^2 + y^2]) x -> λ; w -> x (define (sq x) (* x x)) (define (p0 x y) (/ (sqrt (+ (sq x) (sq y))))) (define (i x y λ) (/ (sq λ) (sqrt (+ (sq (- λ x)) (sq y))))) (define (si x y λ) (let* ((e (+ (sq (- x λ)) (sq y))) (f (sqrt e))) (/ (+ (* (+ (* 3 x) λ) e) (* (- (* 2 x x) (sq y)) f (log (* 2 (+ (- x) λ f))))) (* 2 f)))) ; Better (define (si x y λ) (let ((f (sqrt (+ (sq (- x λ)) (sq y))))) (/ (+ (* (+ (* 3 x) λ) f) (* (- (* 2 x x) (sq y)) (log (* 2 (+ (- x) λ f))))) 2))) (define (D f) (let ((ep 0.0000001)) (lambda (x) (/ (- (f (+ x ep)) (f (- x ep))) (* 2 ep))))) (define (dsi w y) (D (lambda (x) (si w y x)))) ((dsi 2 3) 0.4) ; => 0.047058827945534176 (i 2 3 0.4) ; => 0.04705882352941178 ; Mathematica did the integral right. (define (slp3 x y z) (let ((y (sqrt (+ (sq y) (sq z))))) (- (si x y 1) (si x y 0)))) (define ((poi p) x y z) (let ((e 0.00001)) (/ (- (* 6 (p x y z)) (+ (p (+ x e) y z) (p (- x e) y z) (p x (+ y e) z) (p x (- y e) z) (p x y (+ z e)) (p x y (- z e)))) (* e e)))) ((poi slp3) 0.84 1.21 0.92) ; => -2.4e-5 good. ; Perhaps that is a good enough validation of si. ; For modest performance improvement we specialize (si x y 1) and (si x y 0). (si x y 1) = (let ((f (sqrt (+ (sq (- x 1)) (sq y))))) (/ (+ (* (+ (* 3 x) 1) f) (* (- (* 2 x x) (sq y)) (log (* 2 (+ (- x) 1 f))))) 2))) = (let ((f (sqrt (+ (sq (- x 1)) (sq y))))) (/ (+ (* (+ (* 3 x) 1) f) (* (- (* 2 x x) (sq y)) (log (* 2 (+ (- x) 1 f))))) 2)) (si x y 0) = (let ((f (sqrt (+ (sq x) (sq y))))) (/ (+ (* (+ (* 3 x) 0) f) (* (- (* 2 x x) (sq y)) (log (* 2 (+ (- x) 0 f))))) 2)) = (let ((f (sqrt (+ (sq x) (sq y))))) (/ (+ (* 3 x f) (* (- (* 2 x x) (sq y)) (log (* 2 (- f x))))) 2)) (define (slp3 x y z) (let* ((y2 (+ (sq y) (sq z)))(x2 (sq x))(d (- (* 2 x2) y2))) (/ (- (let ((f (sqrt (+ (sq (- x 1)) y2)))) (+ (* (+ (* 3 x) 1) f) (* d (log (* 2 (+ (- x) 1 f)))))) (let ((f (sqrt (+ x2 y2)))) (+ (* 3 x f) (* d (log (* 2 (- f x))))))) 2))) (define (slp3 x y z) (let* ((y2 (+ (sq y) (sq z)))(x2 (sq x)) (f (sqrt (+ (sq (- x 1)) y2)))(g (sqrt (+ x2 y2)))) (* 1/2 (+ (* 3 x (- f g)) f (* (- (* 2 x2) y2) (log (/ (- f (- x 1))(- g x)))))))) ; This is ugly, more code but less computing. (slp3 300 400 0) ; => 0.00066727 (distance = 500 and mass is 1/3) (slp3 300 0 400) ; ditto (slp3 400 0 300) ; => 0.00066747 (slp3 -400 0 300); => 0.00066587 (slightly closser to weak end)