Suppose that we are given continuous function y=f(x) on [a,b] such that f(x)≥0 for all
x∈[a,b].
We want to find area S that lies under curve f(x) and bounded by lines x=a, x=b and x-axis.
Before doing this imagine right bound b is not fixed, we can move it. Then for different values of right bound we will obtain different values of area, so we can consider area as function P(x) of right bound. In particular, P(a)=0 (because area from a to a is 0) and P(b)=S.
To get a better understanding what is P(x) consider next example.
Example 1. Consider function y=x−1. If P(x) represents area of figure under y=x, above x-axis on interval [1,x] find P(1), P(2), P(3) and P(4).
P(1) is area on interval [1,1], so it is 0 (because length of interval is 0).
P(2) is area on interval [1,2]. It is area of right-angled triangle with legs 1 and 1. So, P(2)=21⋅1⋅1=21.
P(3) is area on interval [1,3]. It is area of right-angled triangle with legs 2 and 2. So, P(3)=21⋅2⋅2=2.
P(4) is area on interval [1,4]. It is area of right-angled triangle with legs 3 and 3. So, P(4)=21⋅3⋅3=29.
As can be seen P(x) is indeed function: for any particular value of x there is corresponding P(x).

Now, suppose we want to find derivative of P(x). For this increase x by Δx. Corresponding increase in area is ΔP=P(x+Δx)−P(x) (figure ACEF).
If we denote maximum and minimum value of f(x) on interval [x,x+Δx] by M and m respectively, then area of figure ACEF is less than area of rectangle ACDF and greater than area of rectangle ABEF.
Since area of rectangle ACDF is MΔx (height multiplied by base)and area of rectangle ABEF is mΔx then
mΔx<ΔP<MΔx or m<ΔxΔP<M.
Now let Δx→0. Since f is continuous then both m and M approach f(x).
Thus, by Squeeze Theorem limΔx→0ΔxΔP=f(x).
But we recognize in limΔx→0ΔxΔP derivative of P(x), so P′(x)=f(x).
In other words P(x)=∫f(x)dx=F(x)+C.
Since P(a)=0 then 0=P(a)=F(a)+C or C=−F(a).
Therefore, P(x)=F(x)−F(a).
Newton-Leibniz Formula. Area of figure P(x) that lies under curve y=f(x), above x-axis on interval [a,x] is P(x)=F(x)−F(a).
Returning to our initial problem we have that S=F(b)−F(a).
Area of figure that lies under curve y=f(x), above x-axis and between lines x=a and x=b is S=F(b)−F(a) where F is antiderivative of f.
Example 2. Find area under y=x2, above x-axis on interval [0,2].
We have that F(x)=∫x2dx=31x3 (note that we need particular derivative here).
Now, according to Newton-Leibniz Formula required area is S=F(2)−F(0)=31⋅23−31⋅03=38.
All from above can be easily extended on case when function can take negative values. For this we only need to consider areas under x-axis negative.
Indeed, if we want to find area enclose by parabola y=−x2, x-axis on interval [0,2] then according to Newton-Leibniz Formula we have that S=F(2)−F(0) where F(x)=∫−x2dx=−31x3. So, S=−38. Since −x2 is reflection of x2 about x-axis then this area lies below x-axis, and, therefore, negative.