I've got this task:
Use Mathematica to obtain an approximate value for the area between the curve $y=1/4$ and the x-axis over the interval $[1,2]$ with $50$ subintervals using the left endpoint, midpoint and right endpoint approximations. Note: the entire calculation needs to be shown in Mathematica.
Here's what I've tried:
a = 1; b = 2; n = 20;
Ln = (b - a[f)/n*Sum[f[a + (i - 1) (b - a) / n], {i, 1, n}]
LeftSum[f_, a_, b_, n_] := (b - a)/n* Sum[f[a + (i - 1) (b - a)/n], {i, 1, n}]
f[x_] := 1/xLeft = N[LeftSum[f, 1, 2, 20]]
Comments
Post a Comment