Accumulation Functions

The upper limit is the variable xx, so the variable of integration needs another letter. It is a dummy variable, and tt is the usual choice.
When f ≥ 0 and x > a, g(x) is the area of the region from a to x.
For x>ax > a, where the graph of ff is below the axis, that part of the region counts as negative, as in any integral. At x=ax = a the interval has no width, so g(a)=0g(a) = 0. For x<ax < a the limits are reversed, and
g(x)=∫axf(t) dt=−∫xaf(t) dt.g(x) = \int_{a}^{x} f(t)\,dt = -\int_{x}^{a} f(t)\,dt.

Interactive: The Accumulation Function

In the graph below, f(t)=t2f(t) = t^2, a=0a = 0, and the accumulation function is named FF instead of gg. Drag xx to the left of 00 as well. There t2t^2 is still positive, but F(x)F(x) is negative, because the limits are reversed.

The Second Fundamental Theorem

When xx increases by a small amount hh, gg gains the area of a thin strip from xx to x+hx + h. The strip is nearly a rectangle of height f(x)f(x) and width hh, so g(x+h)−g(x)≈f(x) hg(x + h) - g(x) \approx f(x)\,h.
The strip from x to x + h.
The strip gives the reason. For h>0h > 0, the change g(x+h)−g(x)g(x + h) - g(x) is the integral of ff from xx to x+hx + h, and by the Mean Value Theorem for Integrals it equals f(c) hf(c)\,h for some cc between xx and x+hx + h. For h<0h < 0 the strip is to the left of xx, but the same theorem on [x+h,x][x + h, x] gives the same equation. So the difference quotient g(x+h)−g(x)h\frac{g(x + h) - g(x)}{h} equals f(c)f(c). As h→0h \to 0, cc is squeezed to xx, and f(c)→f(x)f(c) \to f(x) because ff is continuous.
The College Board calls this theorem and the one that evaluates an integral as F(b)−F(a)F(b) - F(a) together the Fundamental Theorem of Calculus.

A function as a limit of integration

With g(x)=∫axf(t) dtg(x) = \int_a^x f(t)\,dt, an integral whose upper limit is a function u(x)u(x) is g(u(x))g(u(x)), a composition. The chain rule gives g′(u(x)) u′(x)g'(u(x))\,u'(x), and g′=fg' = f.
When both limits are functions uu and vv, differentiable with values in II, split the integral at aa:
∫v(x)u(x)f(t) dt=∫au(x)f(t) dt−∫av(x)f(t) dt.\begin{aligned} &\int_{v(x)}^{u(x)} f(t)\,dt \\[4pt] &\qquad = \int_{a}^{u(x)} f(t)\,dt - \int_{a}^{v(x)} f(t)\,dt. \end{aligned}
Each integral on the right is one of the kind above, so
ddx∫v(x)u(x)f(t) dt=f(u(x)) u′(x)−f(v(x)) v′(x).\begin{aligned} &\frac{d}{dx}\int_{v(x)}^{u(x)} f(t)\,dt \\[4pt] &\qquad = f\bigl(u(x)\bigr)\,u'(x) - f\bigl(v(x)\bigr)\,v'(x). \end{aligned}

An antiderivative with a given value

By the Second Fundamental Theorem, an accumulation function of ff is an antiderivative of ff. So every function continuous on an interval has an antiderivative there. Now let ff be continuous on an interval II containing aa, and F′=fF' = f on II. Since FF is an antiderivative of ff, F(x)−F(a)F(x) - F(a) is the integral of ff from aa to xx, so for xx in II,
F(x)=F(a)+∫axf(t) dt.F(x) = F(a) + \int_{a}^{x} f(t)\,dt.