Defining the Left/Right sums

The simplest way to approximate an integral is using the left-hand sum or the right-hand sum.

leftSum[n_] := {Δx = (b - a)/n ; N[Underoverscript[∑, k = 0, arg3] (f[a + k Δx] Δx), 20]}

rightSum[n_] := {Δx = (b - a)/n ; N[Underoverscript[∑, k = 1, arg3] (f[a + k Δx] Δx), 20]}

In these definitions, I compute Δx inside the leftSum/rightSum functions because it depends on n (which you won't know until the function is called).  Also, don't confuse N with n.  N is a Mathematica function that is telling the program how many digits precision we should use (I arbitrarily chose 20 digits).  n is the number of subdivisions.

This lists the left-hand and right-hand sums for different numbers of subdivisions n:

TableForm[Table[{n, leftSum[n], rightSum[n]}, {n, 100, 1000, 100}], TableHeadings {None, {"n", "LHS", "RHS"}}]

n LHS RHS
100
1.9248595511698364134
1.9291708676059080025
200
1.9259522284001378183
1.9281078866181736128
300
1.9263142544597990703
1.9277513599384896000
400
1.9264948550389291754
1.9275726841479470727
500
1.9266030834013952095
1.9274653466886095273
600
1.9266751806491492182
1.9273937333884944830
700
1.9267266517474423757
1.9273425540954526027
800
1.9267652403406265361
1.9273041548951354848
900
1.9267952449616704353
1.9272742801212339452
1000
1.9268192431591012223
1.9272503748027083812

Created by Mathematica  (April 22, 2004)