Having trouble understanding the finite element method I am trying to read some sources on how to implement the finite element method and I am having difficulty putting all the concepts together.
I can read and understand the Galerkin approach just fine. Then when I read the introduction to Sobolev spaces, weak derivatives, seminorms and Lax-Milgram it is a bit of a struggle but I can follow along with difficulty.
After you construct a bilinear form and a linear functional to reduce your differential equation to 
$$a(u,v) = l(v)$$
however, I get completely lost. For example, the wikipedia entry here
http://en.wikipedia.org/wiki/Finite_element_method
provides an example which begins with constructing the weak formulation and partitioning the domain, but after that, I cannot follow how they arrive at the matrix form. In the subsection, "Matrix form of the problem", they are skipping a couple steps when substituting variables and rewriting the equation that I cannot follow both in terms of mechanical calculation and motivation.
Another example can be found here Finite Element Method for a Two-Point Problem where user sportingdan uses an ansatz equation to substitute into the weak formulation. Except again, I cannot figure out the motivation behind the ansatz equation, or even mechanically reproduce the substitution.
I am under the impression that the step I am having difficulty overcoming is related to the Galerkin approach, but at this point I have studied so many different norms that I am starting to lose confidence that I can properly manipulate any of these equations. 
Edit: I forgot to add that I am also interested in how to handle the case where we have higher order basis functions, it seems to me that the only choice are to use uniform or non uniform kth order B-splines, but it isn't clear how much freedom I have to choose something else.
 A: EDIT: I created a document in English with second-order elements: http://homepage.cem.itesm.mx/jose.luis.gomez/fem/MEF00450secondOrder.pdf (END EDIT)
"...the motivation behind the ansatz equation..." is that you are looking for a linear combination of some base functions that will be the best approximation to the unknwon solution. Those base functions are choosen son that they have local support (each one is different from zero only in a small subdomain, notice each small subdomain is made of several elements in the discretization). Once the base functions are selected, the goal becomes to find the coefficients of the linear combination. Replacing the linear combination into the weak formulation and performing the integrals gives linear algebraic equations for the coefficients, which is the "...matrix formulation...". I believe the graphs and equations and exercises at the end of the document in this link http://homepage.cem.itesm.mx/jose.luis.gomez/fem/MEF00200SoporteLocal.pdf 
will be useful, eventhough the explanations are in Spanish. Please notice that it is a very simple, didactic document, where calculations are not perfomed in the usual way in Finite Element. For example, the integrals should be perfomed in an approximation (Gauss quadrature) and in local coordinates within each element. A second document, which is closer to the actual FEM calculations, is in this other link: http://homepage.cem.itesm.mx/jose.luis.gomez/fem/MEF00400quadrature.pdf
