def show_f_dx_sum(self):
    kwargs = {'x_min': self.lower_bound, 'x_max': self.upper_bound, 'fill_opacity': 0.75, 'stroke_width': 0.25}
    low_opacity = 0.25
    start_rect_index = 3
    num_shown_sum_steps = 5
    last_rect_index = ((start_rect_index + num_shown_sum_steps) + 1)
    self.rect_list = self.get_riemann_rectangles_list(self.graph, self.n_riemann_iterations, **kwargs)
    rects = self.rects = self.rect_list[0]
    rects.save_state()
    start_rect = rects[start_rect_index]
    f_brace = Brace(start_rect, LEFT, buff=0)
    dx_brace = Brace(start_rect, DOWN, buff=0)
    f_brace.label = f_brace.get_text('$f(x)$')
    dx_brace.label = dx_brace.get_text('$dx$')
    flat_rects = self.get_riemann_rectangles(self.get_graph((lambda x: 0)), dx=0.5, **kwargs)
    self.transform_between_riemann_rects(flat_rects, rects, replace_mobject_with_target_in_scene=True)
    self.play(*[ApplyMethod(rect.set_fill, None, (1 if (rect is start_rect) else low_opacity)) for rect in rects])
    self.play(*it.chain(list(map(GrowFromCenter, [f_brace, dx_brace])), list(map(Write, [f_brace.label, dx_brace.label]))))
    self.wait()
    for i in range((start_rect_index + 1), last_rect_index):
        self.play(rects[(i - 1)].set_fill, None, low_opacity, rects[i].set_fill, None, 1, f_brace.set_height, rects[i].get_height(), f_brace.next_to, rects[i], LEFT, 0, dx_brace.next_to, rects[i], DOWN, 0, *[MaintainPositionRelativeTo(brace.label, brace) for brace in (f_brace, dx_brace)])
    self.wait()
    self.play(*it.chain(list(map(FadeOut, [f_brace, dx_brace, f_brace.label, dx_brace.label])), [rects.set_fill, None, kwargs['fill_opacity']]))
def show_f_dx_sum(self):
    kwargs = {'x_min': self.lower_bound, 'x_max': self.upper_bound, 'fill_opacity': 0.75, 'stroke_width': 0.25}
    low_opacity = 0.25
    start_rect_index = 3
    num_shown_sum_steps = 5
    last_rect_index = ((start_rect_index + num_shown_sum_steps) + 1)
    self.rect_list = self.get_riemann_rectangles_list(self.graph, self.n_riemann_iterations, **kwargs)
    rects = self.rects = self.rect_list[0]
    rects.save_state()
    start_rect = rects[start_rect_index]
    f_brace = Brace(start_rect, LEFT, buff=0)
    dx_brace = Brace(start_rect, DOWN, buff=0)
    f_brace.label = f_brace.get_text('$f(x)$')
    dx_brace.label = dx_brace.get_text('$dx$')
    flat_rects = self.get_riemann_rectangles(self.get_graph((lambda x: 0)), dx=0.5, **kwargs)
    self.transform_between_riemann_rects(flat_rects, rects, replace_mobject_with_target_in_scene=True)
    self.play(*[ApplyMethod(rect.set_fill, None, (1 if (rect is start_rect) else low_opacity)) for rect in rects])
    self.play(*it.chain(list(map(GrowFromCenter, [f_brace, dx_brace])), list(map(Write, [f_brace.label, dx_brace.label]))))
    self.wait()
    for i in range((start_rect_index + 1), last_rect_index):
        self.play(rects[(i - 1)].set_fill, None, low_opacity, rects[i].set_fill, None, 1, f_brace.set_height, rects[i].get_height(), f_brace.next_to, rects[i], LEFT, 0, dx_brace.next_to, rects[i], DOWN, 0, *[MaintainPositionRelativeTo(brace.label, brace) for brace in (f_brace, dx_brace)])
    self.wait()
    self.play(*it.chain(list(map(FadeOut, [f_brace, dx_brace, f_brace.label, dx_brace.label])), [rects.set_fill, None, kwargs['fill_opacity']]))