# The Fundamental Theorem of Calculus

## Related Calculator: Definite and Improper Integral Calculator

When we introduced definite integrals we computed them according to definition as a limit of Riemann sums and we saw that this procedure is not very easy. In fact there is a much simpler method for evaluating integrals.

We already discovered it when we talked about Area Problem first time.

There we introduced function `P(x)` whose value is area under function `f` on interval `[a,x]` (`x` can vary from `a` to `b`).

Now when we know about definite integrals we can write that `P(x)=int_a^xf(t)dt` (note that we changes `x` to `t` under integral in order not to mix it with upper limit).

Also we discovered Newton-Leibniz formula which states that `P'(x)=f(x)` and `P(x)=F(x)-F(a)` where `F'=f`.

Here we will formalize this result and give another proof because these fact are very important in calculus: they connect differential calculus with integral calculus.

**The Fundamental Theorem of Calculus**. Suppose `f` is continuous on `[a,b]`.

- If `P(x)=int_a^x f(t)dt`, then `P'(x)=f(x)`.
- `int_a^b f(x)dx=F(b)-F(a)` where F is any antiderivative of `f`, that is `F'=f`.

Part 1 can be rewritten as `d/(dx)int_a^x f(t)dt=f(x)`, which says that if `f` is integrated and then the result is differentiated, we arrive back at the original function.

Part 2 can be rewritten as `int_a^bF'(x)dx=F(b)-F(a)` and it says that if we take a function `F`, first differentiate it, and then integrate the result, we arrive back at the original function `F`, but in the form `F(b)-F(a)`.

Fundamental Theorem of Calculus says that differentiation and integration are inverse processes.

Proof of Part 1. Let `P(x)=int_a^x f(t)dt`. If `x` and `x+h` are in the open interval `(a,b)` then `P(x+h)-P(x)=int_a^(x+h)f(t)dt-int_a^xf(t)dt`.

Now use adjacency property of integral: `int_a^(x+h)f(t)dt-int_a^x f(t)dt=(int_a^x f(t)dt+int_x^(x+h)f(t)dt)-int_a^x f(t)dt=int_x^(x+h)f(t)dt`.

Now apply Mean Value Theorem for Integrals:

`int_x^(x+h)f(t)dt=n(x+h-x)=nh`, where `m'<=n<=M'` (`M'` is maximum value and `m'` is minimum values of `f` on `[x,x+h]`).

So, we obtained that `P(x+h)-P(x)=nh`. If we let `h->0` then `P(x+h)-P(x)->0` or `P(x+h)->P(x)`.

This proves that `P(x)` is continuous function.

Without loss of generality assume that `h>0`.

Since `f` is continuous on `[x,x+h]`, the Extreme Value Theorem says that there are numbers `c` and `d` in `[x,x+h]` such that `f(c)=m` and `f(d)=M`, where `m` and `M` are minimum and maximum values of `f` on `[x,x+h]`.

By comparison property 5 we have `m(x+h-x)<=int_x^(x+h)f(t)dt<=M(x+h-h)` or `mh<=int_x^(x+h)f(t)dt<=Mh`.

This can be divided by `h>0`: `m<=1/h int_x^(x+h)f(t)dt<=M` or `m<=(P(x+h)-P(x))/h<=M`.

Finally, `f(c)<=(P(x+h)-P(x))/h<=f(d)`.

This inequality can be proved for `h<0` similarly.

Now we let `h->0`.

Then `c->x` and `d->x` since `c` and `d` lie between `x` and `x+h`.

So, `lim_(h->0)f(c)=lim_(c->x)f(c)=f(x)` and `lim_(h->0)f(d)=lim_(d->x)f(d)=f(x)` because `f` is continuous.

Therefore, from last inequality and Squeeze Theorem we conclude that `lim_(h->0)(P(x+h)-P(x))/h=f(x)`.

But we recognize in left part derivative of `P(x)`, therefore `P'(x)=f(x)`.

Proof of Part 2. We divide interval `[a,b]` into `n` subintervals with endpoints `x_0(=a),x_1,x_2,...,x_n(=b)` and with width of subinterval `Delta x=(b-a)/n`. Let `F` be any antiderivative of `f`. By subtracting and adding like terms, we can express the total difference in the `F` values as the sum of the differences over the subintervals: `F(b)-F(a)=F(x_n)-F(x_0)=`

`=F(x_n)-F(x_(n-1))+F(x_(n-2))+...+F(x_2)-F(x_1)+F(x_1)-F(x_0)=`

`=sum_(i=1)^n(F(x_i)-F(x_(i-1)))`.

Now `F` is continuous (because it’s differentiable) and so we can apply the Mean Value Theorem to `F` on each subinterval `[x_(i-1),x_i]`.

Thus, there exists a number `x_i^(**)` between `x_(i-1)` and `x_i` such that `F(x_i)-F(x_(i-1))=F'(x_i^(**))(x_i-x_(i-1))=f(x_i^(**)) Delta x`.

Therefore, `F(b)-F(a)=sum_(i=1)^n f(x_i^(**))Delta x` .

Now we take the limit of each side of this equation as `n->oo`. The left side is a constant and the right side is a Riemann sum for the function `f`, so `F(b)-F(a)=lim_(n->oo) sum_(i=1)^n f(x_i^(**)) Delta x=int_a^b f(x)dx` .

This finishes proof of Fundamental Theorem of Calculus.

When using Evaluation Theorem following notation is used: `F(b)-F(a)=F(x)|_a^b=[F(x)]_a^b` .

We already talked about introduced function `P(x)=int_a^x f(t)dt`.

We will talk about it again because it is new type of function. It is just like any other functions (power or exponential): for any `x` `int_a^xf(t)dt` gives definite number. Sometimes we can represent `P(x)` in terms of functions we know, sometimes not.

For example, we know that `(1/3x^3)'=x^2`, so according to Fundamental Theorem of calculus `P(x)=int_0^x t^2dt=1/3x^3-1/3*0^3=1/3x^3`. Here we expressed `P(x)` in terms of power function.

But we can't represent in terms of elementary functions, for example, function `P(x)=int_0^x e^(x^2)dx`, because we don't know what is antiderivative of `e^(x^2)`. What we can do is just to value of `P(x)` for any given `x`.

Geometrically `P(x)` can be interpreted as the net area under the graph of `f` from `a` to `x`, where `x` can vary from `a` to `b`. (Think of g as the "area so far" function).

**Example 1**. Graph of `f` is given below. If `P(x)=int_0^xf(t)dt`, find `P(0)`, `P(1)`, `P(2)`, `P(3)`, `P(4)`, `P(6)`, `P(7)`. Sketch the rough graph of `P`.

We immediately have that `P(0)=int_0^0f(t)dt=0`. We can see that `P(1)=int_0^1 f(t)dt` is area of triangle with sides 1 and 2. Therefore, `P(1)=1/2 *1*2=1`.

We see that `P(2)=int_0^2f(t)dt` is area of triangle with sides 2 and 4 so `P(2)=1/2*2*4=4`.

Area from 0 to 3 consists of area from 0 to 2 and area from 2 to 3 (triangle with sides 1 and 4):

`P(3)=int_0^3f(t)dt=int_0^2f(t)dt+int_2^3f(t)dt=4+1/2*1*4=6`.

Similarly `P(4)=P(3)+int_3^4f(t)dt`. But area of triangle on interval `[3,4]` lies below x-axis so we subtract it: `P(4)=6-1/2*1*4=4`.

Now `P(5)=P(4)+int_4^5 f(t)dt=4-1/2*1*4=2`.

`P(6)=P(5)+int_5^6f(t)dt=2+1/2*1*4=4`.

Finally, `P(7)=P(6)+int_6^7 f(t)dt` where `int_7^6 f(t)dt` is area of rectangle with sides 1 and 4. So, `P(7)=4+1*4=8`.

Sketch of `P(x)` is shown below.

**Example 2**. If `P(x)=int_1^x t^3 dt` , find a formula for `P(x)` and calculate `P'(x)`.

Using part 2 of fundamental theorem of calculus and table of indefinite integrals we have that `P(x)=int_1^x t^3 dt=(t^4/4)|_1^x=x^4/4-1/4`.

Now, `P'(x)=(x^4/4-1/4)'=x^3`. We see that `P'(x)=f(x)` as expected due to first part of Fundamental Theorem.

**Example 3**. Find derivative of `P(x)=int_0^x sqrt(t^3+1)dt`.

Using first part of fundamental theorem of calculus we have that `g'(x)=sqrt(x^3+1)`.

**Example 4**. Find `d/(dx) int_2^(x^3) ln(t^2+1)dt`.

Here we have composite function `P(x^3)`. To find its derivative we need to use Chain Rule in addition to Fundamental Theorem.

Let `u=x^3` then `(du)/(dx)=(x^3)'=3x^2`.

`d/(dx) int_2^(x^3) ln(t^2+1)dt=d/(du) int_2^u ln(t^2+1) *(du)/(dx)=d/(du) int_2^u ln(t^2+1) *3x^2=`

`=ln(u^2+1) *3x^2=ln((x^3)^2+1) *3x^2=3x^2ln(x^6+1)`.

Now, a couple examples concerning part 2 of Fundamental Theorem.

**Example 5**. Calculate `int_0^5e^xdx`.

Using part 2 of fundamental theorem of calculus and table of indefinite integrals we have that `int_0^5e^x dx=e^x|_0^5=e^5-e^0=e^5-1`.

**Example 6**. Calculate `int_0^(pi/2)cos(x)dx`.

Using part 2 of fundamental theorem of calculus and table of indefinite integrals (antiderivative of `cos(x)` is `sin(x)`) we have that `int_0^(pi/2)cos(x) dx=sin(x)|_0^(pi/2)=sin(pi/2)-sin(0)=1`.

**Example 7**. Find `int_0^2 (3x^2-7)dx`.

Using properties of definite integral we can write that `int_0^2(3x^2-7)dx=int_0^2 3x^2dx-int_0^2 7dx=3 int_0^2 x^2dx-7 int_0^2 7dx=`

`=3 (x^3/3)|_0^2-7*(2-0)=3 (8/3 -0/3)-14=-6`.

**Example 8**. Find `int_1^3 ((2t^5-8sqrt(t))/t+7/(t^2+1))dt` .

First rewrite integral a bit: `int_1^3 ((2t^5-8sqrt(t))/t+7/(t^2+1))dt=int_1^3 (2t^4-8t^(-1/2)+7/(t^2+1))dt`

So, `int_1^3 (2t^4-8t^(-1/2)+7/(t^2+1))dt=(2/5 t^5-16sqrt(t)+7tan^(-1)(t))|_1^3=`

`=(2/5 (3)^5-16sqrt(3)+7tan^(-1)(3))-(2/5 (1)^5-16sqrt(1)+7tan^(-1)(1))=`

`=564/5-16sqrt(3)-(7pi)/4+7tan^(-1)(3)~~88.3327`.