Additional material:
Pic taken directly from math is fun.
You can have absolutely any mathematical function like the one char below represents.

Integration calculates area between the line that function draws and X axis.
The reason I say function you pass into Simpsons integration doesn't matter is because ANY function can be used as long as it fits "1 number in, 1 number out" format.
End of additional material.
Simpson's formula is an integration which means it needs a mathematical function to calculate with. Below is the rough formula of simpson's integration (using numbers you passed as arguments and a random function) if you are interested, if not skip this part .
intervalBegin = 1;
intervalEnd = 4;
partitionNumbers = 20;
f(x) = 3x^2;
deltaX = (intervalEnd - intervalBegin) / partitionNumbers;
SimpsonsIntegration = deltaX/3 * (f(intervalBegin) + 4*f(intervalBegin + deltaX*1)+ 2*f(intervalBegin + deltaX*2)+ 4*f(intervalBegin + deltaX*3)+ 2*f(intervalBegin + deltaX*4).....+4*f(intervalBegin + deltaX*19) +f(intervalEnd);
The function in Simpsons integration is ANY function that takes 1 numeric argument and returns one. (it might be type specific like float or double)
public double anyFunction(double number){
double result = [calculations];
return calculations;
}
Your call could look like this:
MathNet.Numerics.Integration.SimpsonRule.IntegrateComposite(anyFunction, 1, 4, 20);