def add_graph_and_integral(self):
    self.setup_axes()
    integral = TexMobject('\\int', '^b', '_a', 'f(x)', '\\,dx')
    integral.next_to(ORIGIN, LEFT)
    integral.to_edge(UP)
    integral.set_color_by_tex('a', self.lower_bound_color)
    integral.set_color_by_tex('b', self.upper_bound_color)
    graph = self.get_graph((lambda x: ((((((- 0.01) * x) * (x - 3)) * (x - 6)) * (x - 12)) + 3)))
    self.add(integral, graph)
    self.graph = graph
    self.integral = integral
    self.bound_labels = VGroup()
    self.v_lines = VGroup()
    for (bound, tex) in ((self.lower_bound, 'a'), (self.upper_bound, 'b')):
        label = integral.get_part_by_tex(tex).copy()
        label.scale(1.5)
        label.next_to(self.coords_to_point(bound, 0), DOWN)
        v_line = self.get_vertical_line_to_graph(bound, graph, color=label.get_color())
        self.bound_labels.add(label)
        self.v_lines.add(v_line)
        self.add(label, v_line)
def add_graph_and_integral(self):
    self.setup_axes()
    integral = TexMobject('\\int', '^b', '_a', 'f(x)', '\\,dx')
    integral.next_to(ORIGIN, LEFT)
    integral.to_edge(UP)
    integral.set_color_by_tex('a', self.lower_bound_color)
    integral.set_color_by_tex('b', self.upper_bound_color)
    graph = self.get_graph((lambda x: ((((((- 0.01) * x) * (x - 3)) * (x - 6)) * (x - 12)) + 3)))
    self.add(integral, graph)
    self.graph = graph
    self.integral = integral
    self.bound_labels = VGroup()
    self.v_lines = VGroup()
    for (bound, tex) in ((self.lower_bound, 'a'), (self.upper_bound, 'b')):
        label = integral.get_part_by_tex(tex).copy()
        label.scale(1.5)
        label.next_to(self.coords_to_point(bound, 0), DOWN)
        v_line = self.get_vertical_line_to_graph(bound, graph, color=label.get_color())
        self.bound_labels.add(label)
        self.v_lines.add(v_line)
        self.add(label, v_line)