Lagrangian is:

Subject to the normalization constrain:
![N[\psi] = \int|\psi(x)|^2 \d^3 x - 1 = 0](../../_images/math/8a57e44499a920eaeda62ef856431a780208a469.png)
The action is:
![S[\psi] = \int \L \d^3 x](../../_images/math/dfb60cb45cbd9d3188b8a89723b2a08584df6635.png)
Variating it (subject to the normalization condition) we get:

Which gives the Schrödinger equation assuming the surface integral vanishes.
Note: to apply the variation
correctly, one uses the definition:
![\delta F[\psi] \equiv \left.{\d\over\d\epsilon}F[\psi + \epsilon \delta\psi]
\right|_{\epsilon=0}](../../_images/math/5811514056d66a702a585488c2c4b37f0a0508a8.png)
The weak formulation is obtained from the above by substituting
(the test function) so we get:

There are two ways to obtain the radial Schrödinger equation. Either from the Lagrangian, or from the equation itself.

The way to solve it is to separate the equation into radial and angular parts by writing the Laplace operator in spherical coordinates as:


Substituting
into the Schrödinger equation
yields:


Using the fact that
we can cancel
and we get the radial
Schrödinger equation:

Normalization:

We need to convert the Lagrangian to spherical coordinates. In order to easily make sure we do things covariantly, we start from the action (which is a scalar):
![S[\psi] = \int \half (\nabla \psi)^2 + V(x) \psi^2(x) \, \d^3 x =
= \int (\half (\nabla (RY))^2 + V (RY)^2 )\rho^2\d \rho \d\Omega =
= \int (\half (R'^2Y^2 + R^2(\nabla Y)^2 + 2RR'({\bf\hat\rho}Y)\cdot\nabla Y) + V (RY)^2 )\rho^2\d \rho \d\Omega =
= \int \left(\half \left(R'^2 + R^2{l(l+1)\over\rho^2}\right) + V R^2\right)\rho^2\d \rho =
= \int \half \rho^2 R'^2 + (\rho^2 V + \half l(l+1)) R^2\,\d \rho =](../../_images/math/313dd6c0804c009ed082fe9f1e1cd7c155e76404.png)
where we used the following properties of spherical harmonics:

We now minimize the action (subject to the normalization
) to obtain the radial equation:
![0 = \delta (S - \epsilon N) = \delta
\int \half \rho^2 R'^2 + (\rho^2 V + \half l(l+1)) R^2 - \epsilon \rho^2R^2
\,\d \rho =
= 2\int \half \rho^2 R'(\delta R)' + (\rho^2 V + \half l(l+1)) R\delta R -
\epsilon \rho^2 R\delta R \,\d \rho =
= 2\int \left( (-\half \rho^2 R')' + (\rho^2 V + \half l(l+1)) R - \epsilon \rho^2
R\right)\delta R \,\d \rho + [\rho^2 R' \delta R]^a_b](../../_images/math/e049d62930ffc8cffadaf2015a7e7637bc050fd1.png)
So the radial equation is:
(1)
In agreement with the previous result.
We introduce
and
by
and
. The
radial Schrödinger equation is then:

Let
and
represent the radial wave function and its derivative at
and
,
at
, so the following holds:

Now we evaluate
using the relations above:

We integrate the last formula on the intervals
and
:
![[Q_2 P_1 - P_2 Q_1]^{a_c}_0
= 2 (E_1 - E_2) \int^{a_c}_0 P_1(r) P_2(r) \,\d r
[Q_2 P_1 - P_2 Q_1]^\infty_{a_c}
= 2 (E_1 - E_2) \int^\infty_{a_c} P_1(r) P_2(r) \,\d r](../../_images/math/6781b0d44583febabaa4e591082dd8b8b23aaeb6.png)
On the interval
we know the exact solution corresponding to the
energies
and
by integrating outwards (the solution will eventually
diverge for large
except for the eigenvalues, but we only need it up to
) and we know that
, so we get:

where
means that we need the values at
when integrating the
equation from the left (the value will generally be different when integrating
the equation from the right, unless the energy is an eigenvalue).
Similarly on the other interval where
:

Taking the sum of the last two expressions:

Now we use the fact that
and
, because we match the two solutions from the left and
right, so that the function is continuous (it’s derivative will have a jump
though):

By requiring, that the energy
is an eigenvalue, it follows that there is
no jump in the derivative, so we set
and we get:

that gives us an exact formula for the eigenvalue
:

We approximate the value of
by
as well as the integral
by
and we
get an approximation for the eigenenergy:

We use this approximation iteratively until the convergence is achieved (the
discontinuity in
at
is small enough, or equivalently, the
correction to the energy is small enough).
For Dirac equation, one obtains a similar formula:

So it is just the previous formula multiplied by
and the normalization is
calculated using both
and
(as usual for the Dirac equation).
The weak formulation is obtained from the action above by substituting
(the test function) so we get:

We can also start from the equation itself, multiply by a test function
:

We integrate it. Normally we need to be using
in order to
integrate covariantly, but the above equation was already multiplied by
(i.e. strictly speaking, it is not coordinate independent anymore), so
we only integrate by
:

After integration by parts:
![\int \half \rho^2 R'v' + (\rho^2 V + \half l(l+1)) Rv \d\rho
-\half[\rho^2R'v]_0^a
=
\epsilon \int \rho^2 Rv \d\rho](../../_images/math/deee3e64e8d3e4288999a133ac30498203aace43.png)
Where
is the end of the domain (the origin is at
).
The boundary term is zero at the origin, so we get:

We usually want to have the boundary term
equal to zero.
This is equivalent to either letting
(we prescribe the zero
derivative of the radial wave function at
) or we set
(which
corresponds to zero Dirichlet condition for
, i.e. setting
).
We can also write all the formulas using the Dirac notation:

Then normalization is:

The operator
can be written as:

so to recover the above formula, we do:

Operator
is symmetric, because:

The weak formulation is:

and we obtain the FE formulation by expanding
(note that the basis
is not orthogonal, so in particular
):

This is a generalized eigenvalue problem.
In the special case of an orthonormal basis,
(which FE is not), we get:

Which is an eigenvalue problem.
The QED Lagrangian density is

where:

We will treat the fields as classical fields, so we get the classical wave Dirac equation, after plugging this Lagrangian into the Euler-Lagrange equation of motion:

Notice that the Lagrangian happens to be zero for the solution of Dirac equation (e.g. the extremum of the action). This has nothing to do with the variational principle itself, it’s just a coincindence.
In this section we are only interested in the Dirac equation, so we write the Lagrangian as:

where we introduced the potential by
. We also could have done the
same manipulation to the dirac equation itself and we would get the same
expression:

The corresponding eigenvalue problem is:

As for the Schrödinger equation, there are two ways to obtain the radial Dirac equation. Either from the Lagrangian, or from the equation itself.
The manipulations are well known, one starts by writing the Dirac spinors using
the spin angular functions and radial components
and
:

and putting this into the Dirac equation one obtains:

So one obtains the following radial equations:

We can reuse the calculations from the previous sections, because the Lagrangian happens to be zero for the solution of the Dirac equation:

We can now write the action:

the spin angular functions integrate to
:

the
cancels out and we
get:
![S[P, Q] = \int
P
\left(-\hbar c \left({\d\over\d\rho} - {\kappa\over\rho}\right)Q + (V+mc^2)P\right)
+
Q
\left(\hbar c \left({\d\over\d\rho} + {\kappa\over\rho}\right)P + (V-mc^2)Q\right)
\,\d\rho=
=\int -\hbar c(PQ' - QP') + \hbar c {2\kappa\over\rho} PQ +
V(P^2+Q^2) + m c^2 (P^2 - Q^2) \d\rho](../../_images/math/93c146a46c042138a3c8f166f2c5f056b646fa01.png)
the normalization condition is:

and we can variate the action, we also shift the energy
:

which effectively adds
into the Lagrangian, which changes the
term
into
.
We can now variate the (constrained) action:
![0=\delta\int -\hbar c(PQ' - QP') + \hbar c {2\kappa\over\rho} PQ +
V(P^2+Q^2) - 2m c^2 Q^2 \d\rho=
= 2\int \left(-\hbar c((\delta P)Q' - P'\delta Q) + \hbar c{\kappa\over\rho}
((\delta P)Q + P\delta Q)) + (P\delta P + Q\delta Q)V
-2mc^2Q\delta Q - \epsilon(P\delta P + Q\delta Q)\right)\d\rho
+[P\delta Q - Q\delta P]^R_0 =
= 2\int
\delta P \left(-\hbar c Q' + \hbar c{\kappa\over\rho}Q + PV - \epsilon P
\right)+
\delta Q \left(\hbar c P' + \hbar c{\kappa\over\rho}P + QV - 2mc^2Q - \epsilon Q
\right)\d\rho
+[P\delta Q - Q\delta P]^R_0 =](../../_images/math/0b084b7de32de995180e2583b0801a5a710e5b7e.png)
which gives the two radial equations:

The weak formulation can be obtained by substituting
and
into the action above (and separating the integrals) and
omitting the the boundary term:

We can also start from the radial equations themselves to get the same result. If we start from the equations themselves (which is the most elementary approach), there are no boundary terms (because we didn’t integrate by parts). We can separate the integrals according to the matrix elements that they contribute to:

To show that this problem generates a symmetric matrix, it is helpful to write the radial equations in the following form:

where:

the operator
is Hermitean (
), because
:

and all the other quantities are just scalars.
Stricly speaking, the exact Dirac notation (that is coordinate/representation
independent) would be the following (notice the missing
in the
completeness relation, which is different to the radial Schrödinger equation):

The normalization is:

The weak formulation is:

where the test function
is one of:

The FE formulation is then obtained by expanding
:

The basis
can be for example the FE basis, some spline basis set, or
gaussians. The basis has actually
base functions and it enumerates each
equation like this:

So at the end of the day, the
matrix looks like this:

The matrix is
, composed of those 4 matrices
. The
matrix looks like this:

We can also write the matrix elements explicitly. Let
,
then:
