Area under a curve

Part of Calculus in motion

Area under a curve preview
remixableManimCE2Dintegralloop

A curve with the region between it and the x-axis filled across [a, b], and a dashed edge marking the upper limit. The loop sweeps that limit and the fill grows or shrinks with it, the accumulated area counting along in the readout. This is the accumulation-function picture, ready to drop into a fundamental-theorem lesson.

manim/area_under_curve.py

"""Area under a curve: the upper limit sweeping, the fill following it.

Render (the driver does this for every palette; these are for eyeballing):
    P=/opt/homebrew/opt/python@3.11/bin/python3.11
    ASSET_MODE=still  $P -m manim -s -t -r 1600,1600 manim/area_under_curve.py AreaUnderCurve
    ASSET_MODE=motion $P -m manim -qh   -r 1600,1600 manim/area_under_curve.py AreaUnderCurveLoop
"""

import numpy as np
from manim import (
    DOWN,
    LEFT,
    UP,
    DashedLine,
    NumberPlane,
    Text,

The full Manim source and the rendered video come with a plan.