function [ int ] = integral(x, b)

%increment
inc = 0.001;

% rounding x to closest increment value
max = round(x/ inc);
max = max*inc;

grid = [-5:inc:max]';

num = length(grid);

f_0 = exp(b*grid) ./ ( ones(num,1) + exp(b*grid) );
f_1 = exp(b*(grid - ones(num,1))) ./ ( ones(num,1) + exp(b*(grid - ones(num,1))));

diff = f_0 - f_1;

int = sum(diff*inc);




