幾何直觀上和與下和(1)
Author: 藍邦偉  老師

比較下和的差

L_n

L_2_n

U_n

U_2_n

比較上和的差

a = 1.1 (slider from 0.1 to 5, step 0.1)
k = 0.3 (slider from 0 to 0.3, step 0.01)
f(x) = a * x^(2) + k
E = Point(xAxis)
L_1: x = x(E)
F = (1, 0)
L_2: x = x(F)
G = Intersect(f, L_1, 1)
H = Intersect(f, L_2, 1)
a_1: x(E)
b_1: x(F)
l: b_1 - a_1
n = 3 (slider from 3 to 5, step 1)
U_n = UpperSum(f, a_1, b_1, n)
L_n = LowerSum(f, a_1, b_1, n)
list_a = Sequence(x(E) + l / n * k, k, 0, n)
list_b = Sequence((Element[list_a, k], 0), k, 1, n + 1)
list_c = Sequence((Element[list_a, k], f(Element[list_a, k])), k, 1, n + 1)
list_d = Sequence((x(Element[list_b, k + 1]), y(Element[list_c, k])), k, 1, n)
d: l / n
L_{2n} = LowerSum(f, a_1, b_1, 2 * n)
U_{2n} = UpperSum(f, a_1, b_1, 2 * n)
list_f = Sequence(x(E) + l / (2 * n) * k, k, 0, 2 * n)
list_g = Sequence((Element[list_f, k] + l / (2 * n), 0), k, 1, 2 * n, 2)
list_h = Sequence((Element[list_f, k] + l / (2 * n), f(Element[list_f, k] + l / (2 * n))), k, 1, 2 * n, 2)
list_j = Sequence((Element[list_f, k] + l / (2 * n), f(Element[list_f, k])), k, 1, 2 * n, 2)
list_k = Sequence((x(Element[list_b, k + 1]), y(Element[list_h, k])), k, 1, n)
List_A = Sequence(Polygon[Element[list_j, k], Element[list_d, k], Element[list_k, k], Element[list_h, k]], k, 1, n)
list_e = Sequence((x(Element[list_b, k]), y(Element[list_c, k])), k, 1, n + 1)
list_m = Sequence((x(Element[list_b, k]) - l / n, y(Element[list_c, k])), k, 2, n + 1)
list_n = Sequence((x(Element[list_b, k]) - l / (2 * n), y(Element[list_c, k])), k, 2, n + 1)
list_p = Sequence((x(Element[list_g, k]), f(x(Element[list_g, k]))), k, 1, n + 1)
list_q = Sequence((x(Element[list_b, k]) - l / n, y(Element[list_p, k - 1])), k, 2, n + 1)
List_B = Sequence(Polygon[Element[list_q, k], Element[list_p, k], Element[list_n, k], Element[list_m, k]], k, 1, n)
c = false
e = false
g = false
h = false
i = false
j = false
u = Vector((x(Corner[1]), 0), (x(Corner[3]), 0))
v = Vector((0, y(Corner[1])), (0, y(Corner[3])))
text1: "$ f(x)=" + (LaTeX[f]) + " $"