Hi, i am dealing with the same sort of topic. First let me see if I can make something more clear.
(1) is a PDE (partial differential equation) and (3) is the minimization problem which is derived from (1). Finding a solution for (3) will take some numerical methods. But this solution is also a solution for (1).
Now from (3) to (1):
Let

be the function minimizing this
Substitute this in (3) minimizing problem
Now differentiate with respect to

, and then E(u) reaches a minimum for

. You should get the following:

. I can't derive this but you will get the following;
Use the divergence theorem to get rid of
And use DuBois' Lemma to derive the PDE:

with the boundary condition:

Which is the natural boundary condition. The essential boundary condition was already given, u=0 on Gamma.
I skipped some essential steps cause these are not clear to me either, but I am pretty shure this is the way to go from PDE to minimizing problem.
From minimizing to FEM is the next step. Hope someone can contribute to this!!
Bye Alex