The integral is basically an area under a curve.
Its purpose is to calculate acumulation over time, volume and much more stuff.
Let's take a look at our first example:
Let \(f(x) = 2x\)
Let's find the area under the that line from \(x = 0\) to \\(x = 1\).
In that interval, the function shapes a right triangle, which the base is \(1\) and the height is \(f(1) = 2\).
So to calculate the area, we just do height times base over \(2\):
$$\frac{1 \cdot 2}{2} = 1$$
So the are under that line from \(0\) to \(1\) is \(1\), meaning that the integral from \(0\) to \(1\) of \(f(x)\) is 1:
$$\int_0^1 f(x)\,dx = \int_0^1 2x\,dx = 1$$