Protruding Slices

Under Curve Slices

f(x)

Upper Limit x =

Lower Limit x =

Number of Divisions

Generating a set of rectangles with lower limit
Sequence[Polygon[(dx, 0), (dx, f(dx)), (dx + (ul - ll) / numdiv, f(dx)), (dx + (ul - ll) / numdiv, 0)], dx, ll, ul - (ul - ll) / numdiv, (ul - ll) / numdiv]

Generating a set of rectangles with upper limit

Sequence[Polygon[(dx, 0), (dx, f((dx + (ul - ll) / numdiv)), (dx + (ul - ll) / numdiv, f((dx + (ul - ll) / numdiv)), (dx + (ul - ll) / numdiv, 0)], dx, ll, ul - (ul - ll) / numdiv, (ul - ll) / numdiv]


Generating a set of points on function curve subdivided  within limits

Sequence[(dx, f((dx)), dx, ll, ul - (ul - ll) / numdiv, (ul - ll) / numdiv]


Generating a set of vertical lines subdividing within limits

Sequence[x=dx, dx, ll, ul, (ul - ll) / numdiv]

Move Pointer P_t over any rectangular slice 
to see information on an rectangular slice 

When number of slices increase↑ (each slice smaller!)
→area of slices ≈ actual area under curve (definite integral)

Show Definite Integral

Show Activity Conclusion

f(x) = x^(2)
upperlimit = 3
ul: upperlimit
lowerlimit = 0
ll: lowerlimit
numberofslices = 20 (slider from 1 to 500, step 1)
P_t = (0.5538675197419801, -2.1900561224009216)
SliceNum: floor((x(P_t) - ll) / ((ul - ll) / numberofslices)) + 1
SliceVertex3u: (ll + (ul - ll) / numberofslices * SliceNum, f(ll + (ul - ll) / numberofslices * SliceNum))
SliceVertex2u: (ll + (ul - ll) / numberofslices * (SliceNum - 1), f(ll + (ul - ll) / numberofslices * SliceNum))
SliceVertex4: (ll + (ul - ll) / numberofslices * SliceNum, 0)
SliceVertex1: (ll + (ul - ll) / numberofslices * (SliceNum - 1), 0)
b = true
a = true
inputBox1 = Textfield(f)
inputBox2 = Textfield(upperlimit)
inputBox3 = Textfield(lowerlimit)
inputBox4 = Textfield(numberofslices)
AreabyDefiniteIntegral = Integral(f, ll, ul)
LeftRectanglesEstimate = Sequence(Polygon[(dx, 0), (dx, f(dx)), (dx + (ul - ll) / numberofslices, f(dx)), (dx + (ul - ll) / numberofslices, 0)], dx, ll, ul - (ul - ll) / numberofslices, (ul - ll) / numberofslices)
AreaLeftRectangleEstimate = Sum(LeftRectanglesEstimate)
RightRectanglesEstimate = Sequence(Polygon[(dx, 0), (dx, f(dx + (ul - ll) / numberofslices)), (dx + (ul - ll) / numberofslices, f(dx + (ul - ll) / numberofslices)), (dx + (ul - ll) / numberofslices, 0)], dx, ll, ul - (ul - ll) / numberofslices, (ul - ll) / numberofslices)
AreaRightRectangleEstimate = Sum(RightRectanglesEstimate)
text1: "Total Area of Rectangles (Green ) 
= " + AreaLeftRectangleEstimate + " sq units (lower estimate)"
text2: "Total Area of Rectangles (Orange ) 
= " + AreaRightRectangleEstimate + " sq units (upper estimate)"
VerticalLinesWithinLimits = Sequence(x = dx, dx, ll, ul, (ul - ll) / numberofslices)
PointsOnCurvefWithinLimits = Sequence((dx, f(dx)), dx, ll, ul, (ul - ll) / numberofslices)
SliceVertex2: (ll + (ul - ll) / numberofslices * (SliceNum - 1), f(ll + (ul - ll) / numberofslices * (SliceNum - 1)))
SliceVertex3: (ll + (ul - ll) / numberofslices * SliceNum, f(ll + (ul - ll) / numberofslices * (SliceNum - 1)))
SliceInFocus, c, d, e, g = Polygon(SliceVertex1, SliceVertex2, SliceVertex3, SliceVertex4)
ShowSmallerSlice: (x(P_t) < ul) ∧ (x(P_t) > ll) ∧ (y(P_t) > 0) ∧ (y(P_t) < f(ll + (ul - ll) / numberofslices * (SliceNum - 1))) ∧ a
ShowBiggerSlice: (x(P_t) < ul) ∧ (x(P_t) > ll) ∧ (y(P_t) > 0) ∧ (y(P_t) < f(ll + (ul - ll) / numberofslices * SliceNum)) ∧ b
SliceBiggerInFocus, slicevertex1, slicevertex2u, slicevertex3u, slicevertex4 = Polygon(SliceVertex1, SliceVertex2u, SliceVertex3u, SliceVertex4)
c_1 = 0
c_2 = 0
text7: "f(x) =" + (LaTeX[f]) + ""
text4: "Integration : Total area of rectangular slices under curve f(x) = " + f + ""
i = false
c_3 = 0
txtBigglerSliceAreaCalc: "For Slice " + SliceNum + " (Protruding)
Height of Rectangular Slice =  " + (f(ll + (ul - ll) / numberofslices * SliceNum)) + "
Width of Rectangular Slice = " + ((ul - ll) / numberofslices) + "
Area of Rectangular Slice 
=  " + (f(ll + (ul - ll) / numberofslices * SliceNum)) + "  × " + ((ul - ll) / numberofslices) + " =  " + (Element[RightRectanglesEstimate, SliceNum]) + "  sq units"
txtSmallerSliceAreaCalc: "For Slice " + SliceNum + " (Under curve)
Height of Rectangular Slice = " + (f(ll + (ul - ll) / numberofslices * (SliceNum - 1))) + "
Width of Rectangular Slice =" + ((ul - ll) / numberofslices) + "
Area of Rectangular Slice 
 = " + (f(ll + (ul - ll) / numberofslices * (SliceNum - 1))) + " ×" + ((ul - ll) / numberofslices) + "  =  " + (Element[LeftRectanglesEstimate, SliceNum]) + " sq units"
text3: "Area under curve betw. limits
using definite integral
= $\int_{" + (LaTeX[ll]) + "}^{" + (LaTeX[ul]) + "}{ " + (LaTeX[f]) + "\;\;dx}= \left [  " + (LaTeX[h]) + " \right ]^" + (LaTeX[ul]) + "_" + (LaTeX[ll]) + "$
$" + (LaTeX[h(ul)]) + "-" + (LaTeX[h(ll)]) + " \;=\;\; " + (LaTeX[AreabyDefiniteIntegral]) + "\;\; sq\; units$"
j = false