# Math Help - Numerical Integration

1. ## Numerical Integration

Okay, so the instructions to the problem I have say, " Find the approximate values for each of the following integrals by applying the function simpleTrap" simpleTrap is explained here: Calculus I and II - Lab 17 So I have the problem: $\int_{0}^{2} e^xdx$ in mathematica I get 8.38906, but on my calculator it says 6.38906, which is correct?
This is what I put in for mathematica:
In[6]:= f[x_] := E^x
In[7]:= N[(2 - 0)*(f[0] + f[2])/2]
Out[7]= 8.38906
Thanks,
Matt

2. mathematica is correct ... using the geometry formula for a simple trapezoid ... $A = \frac{1}{2}(1 + e^2)2 = 1 + e^2$