<aside> 👁️
Please check out the Weak Form beforehand
</aside>

In general, f(x) is part of the problem data and is usually provided by the specific physical problem you are trying to solve. Its form can vary:
In analysis, numerical integration comprises a broad family of algorithms for calculating the numerical value of a definite integral. The term numerical quadrature (often abbreviated to quadrature) is more or less a synonym for "numerical integration", especially as applied to one-dimensional integrals
The basic problem in numerical integration is to compute an approximate solution to a definite integral
$$ \int_a^bf(x)dx $$
Gaussian quadrature is one of the most used methods. It constructed to yield an exact result for polynomials of degree 2n − 1 or less by a suitable choice of the nodes x_i and weights w_i for i = 1, ..., n. It states that:
$$ \int_{-1}^1f(x)dx \approx \sum_{i=1}^n w_if(x_i) $$
Which is exact for polynomials of degree 2n − 1 or less.

An integral over [a, b] must be changed into an integral over [−1, 1] before applying the Gaussian quadrature rule. This change of interval can be done in the following way:
$$ \int_a^bf(x)dx = \int_{-1}^1 f(\frac{b - a}{2} \xi + \frac{a + b}{2} ) \frac{dx}{d\xi}d\xi $$