I am trying to understand the Finite element method in one dimension.
I have this set of notes that explains that if $\phi_i$ are a function basis, then we can assume that any function $u$ can be approximated as $u_N = \sum b_i \phi_i$, so far so good.
So a differential equation $A(u) = f$ can be rewritten as $A(\sum b_i \phi_i) = f(x)$ And thus the error can be epxressed as
$$r_N = A(u_n) - f(x)$$.
Super simple so far.
But then it claims that
Now our aim is to determine the coefficients $b_j$ which will make $r_N$ the minimum over the domain of the solution. That’s why we want: $$\int_\Omega r_Nw_i(x)dx$$
Where $w_i$ are weight functions.
How on earth did we go from the residuals to this integral? I don't see any $b_j$ I don't see $\phi_i$ either from that matter, and I don't understand how this integral is related to the minimization problem in the slightest.
I guess what you're missing is that $u_n = \sum b_i \phi_i$, that's where the $b_i$ and $\phi_i$ are hiding.
Then it kind of uses a "feeling" approach to convince of what we need to get, but it's not how finite element methods are mathematically conceived.
It claims that is we minimize the integral, we minimize the residual, there are actually Lemmas behind that, I guess he's trying to hide them in order to stay focus on the understanding of the idea more than being rigorous.
If you want a rigorous way of formulating finite element methods, the book Theory and Practice of Finite Elements Methods, by Alexandre Ern and Jean-Luc Guermond is very very good.