function [I] = v2i(r1, r2, theta, beta, a)
% Integral for the two-jump interaction potential:
%   function [I] = v2i(r1, r2, theta, beta, a).
% Return value I is a matrix in r1, r2, theta, beta, and a.

ns = 1000;
ds = 1.0 / ns;
s  = [ds : ds : 1-ds];

% The return value of v2f is a matrix in s, r, and theta.
% Integrate by summing over s.
u  = v2f(r1, r2, theta, beta, a, s);
I  = sum(u*ds, 6);
