Integrals. The area under the functions
By: Adrià Serra
Tags: Machine Learning, Calculus, Deep Learning, Data Science, Mathematics

CALCULUS FOR DATA SCIENCE AND MACHINE LEARNING

Integrals

The area under the functions

After defining derivatives, we introduce the integrals. Not easy to define, by now we can understand them as the area between the function and the x-axis.

Integral of a bounded region

First, we will define the integrals for bounded regions, assigning the integral of f on [a, b] to the area R(f, a, b). In this example, we use it for an always positive interval, but it is defined for negative and intervals having positive and negative values.

In the next gif, we show how to apply the idea, [a,b] is divided into subintervals, then the minimum(m_i) and maximum(M_i) value of the function for each interval.

IkamusumeFan / CC BY-SA (https://creativecommons.org/licenses/by-sa/3.0)

Now we can define two areas:

The one created by the minimums: s=m1(t1-t0) + m2(t2-t1)+ …

The one created by the maximums: S=M1(t1-t0) + M2(t2-t1)+ …

The area R(f, a, b) is at some point between these values, s≤A≤S.

Lower and upper sums

Let a < b. A partition of the interval [a,b] is a finite collection of points in [a,b], one of which is a, and open of which is b. Suppose f is bounded on [a,b] and P = {t_0,…,t_n} is a partition of [a,b]. Let m1 = inf{f(x):t_(i-1)≤t_i}, M1 = sup{f(x):t_(i-1)≤t_i}, The lower sum off for P, denoted by L(f, P), and the upper sum, denoted by U(f, P) are denoted as:

Lower and upper sums, self-generated.

The next lemma will give you an idea of how we are going to define integrals:

If Q contains P (all points in P are in Q), then: L(f, P)≤L(f, Q) U(f, P)≥U(f, Q)

Integrals

A function f wich is bounded on [a,b] is integrable on [a,b] if sup{L(f, P) : P a partition of [a,b]}. In this case, the common number is called integral of f in [a,b] and is denoted by:

Integral of f in the interval [a,b], self-generated.

If f is integrable, then for all partitions of P of [a,b]:

The area defined by an integral, self-generated.

Moreover the integral is the unique number with this property.

Integrability

To be able to calculate an integral, our function has to be integrable, to check it we can use the next definition:

If f is bounded on [a, b], then f is integrable on [a, b] if and only if for every ε>0 there is a partition P of [a, b] such that U(f,P)-L(f,P)<ε. If f is continuous on [a,b] then f is integrable on [a,b].

Upgrading the notation of integrals

Since now we wrote integrals with the ∫ symbol and defining it between two values, but what happens when we have multiple variables, we don’t know what’s the one with we want to integrate the function.

Including d to integrals, self-generated.

In the left integral we don't know what variable is independent, as for derivatives, we need to integrate based on one variable at the time, so we introduce dx to give this information.

In this example, the solution would be c(b²/2-a²/2).

Properties of integration

Let a<c<b. If f is integrable on [a,b] then f is integrable on [a,c] and on [c,b]. Conversely, if f is integrable on [a,c] and on [c,b], then f is integrable on [a,b]. Finally if f is integrable on [a,b], then

Sum of interval integrals property, self-generated.

If f and g are integrable on [a,b], then f+g is integrable on [a,b] and

Sum of functions integrals property, self-generated.

If f is integral on [a,b], then for any number x, the function cf is integrable on [a,b]

The constant property, self-generated.

Conclusion

In this post, we introduced how integrals are defined, this will allow us to calculate areas under curves of functions. It’s used at deep learning, probability functions, etc…