曲線下的面積
Author: 藍邦偉  老師

.

上和

.

下和

.

.

黎曼和

實際面積

曲線下的面積

.

梯形面積和

.

.

右端點矩形

左端點矩形

n = 1 (slider from 1 to 50, step 1)
k = 0 (slider from 0 to 2, step 1)
s = 0 (slider from 0 to 1, step 1)
a = -5 (slider from -10 to 10, step 1)
A: (a, 0)
b = 10 (slider from -10 to 10, step 1)
B: (b, 0)
d: (x(B) - x(A)) / n
f(x) = sin(x) + 2 * sin(x / 2) + 4
Area = Integral(f, a, b)
u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
c = false
e = false
g = false
h = false
C: (a, f(a))
D: (b, f(b))
i = Segment(C, A)
j = Segment(D, B)
list1 = Sequence(x(A) + If[k ≟ 0, (t + s * 0 + random()) * d, If[k ≟ 1, t * d, (t + 1) * d]], t, 0, n - 1)
list2 = Sequence(Polygon[(x(A) + (t - 1) * d, 0), (x(A) + t * d, 0), (x(A) + t * d, f(Element[list1, t])), (x(A) + (t - 1) * d, f(Element[list1, t]))], t, 1, n)
list3 = Sequence(Segment[(Element[list1, i], 0), (Element[list1, i], f(Element[list1, i]))], i, 1, n)
L_n = LowerSum(f, a, b, n)
U_n = UpperSum(f, a, b, n)
T_n = TrapezoidalSum(f, a, b, n)
l = false
lista = Sequence(Polygon[(a + (i - 1) * d, 0), (a + i * d, 0), (a + i * d, f(a + i * d)), (a + (i - 1) * d, f(a + i * d))], i, 1, n)
listb = Sequence(Polygon[(a + (i - 1) * d, 0), (a + i * d, 0), (a + i * d, f(a + (i - 1) * d)), (a + (i - 1) * d, f(a + (i - 1) * d))], i, 1, n)
m = false
o = false