Quantum Field Theory/Quantization of free fields

Real and complex scalar fields.
The equations of motion for a real scalar field $$ \phi $$ can be obtained from the following lagrangian densities

$$ \begin{matrix} \mathcal{L}& = & \frac{1}{2}\partial_{\mu} \phi \partial^{\mu}\phi - \frac{1}{2} M^2 \phi^2\\ & = & -\frac{1}{2} \phi \left( \partial_{\mu} \partial^{\mu} + M^2 \right)\phi \end{matrix}  $$

and the result is $$\left( \Box+M^2 \right)\phi(x)=0 $$.

The complex scalar field $$ \phi $$ can be considered as a sum of two scalar fields: $$ \phi_1 $$ and $$ \phi_2 $$, $$ \phi=\left(\phi_1+i\phi_2\right)/ \sqrt{2}$$

The Langrangian density of a complex scalar field is

$$ \mathcal{L} =  (\partial_{\mu} \phi)^+ \partial^{\mu}\phi  - M^2 \phi^+ \phi   $$

Klein-Gordon equation
Klein-Gordon equation is precisely the equation of motion for the spin-0 particle as derived above: $$\left( \Box+M^2 \right)\phi(x)=0 $$

Dirac equation
The Dirac equation is given by:

$$\left(i\gamma^\mu\partial_\mu - m\right)\psi\left(x\right) = 0$$

where $$\psi$$ is a four-dimensional Dirac spinor. The $$\gamma$$ matrices obey the following anticommutation relation (known as the Dirac algebra):

$$\left\{\gamma^\mu,\gamma^\nu\right\}\equiv\gamma^\mu\gamma^\nu+\gamma^\nu\gamma^\mu = 2g^{\mu\nu}\times 1_{n\times n}$$

Notice that the Dirac algebra does not define a priori how many dimensions the matrices should be. For a four-dimensional Minkowski space, however, it turns out that the matrices have to be at least $$4\times 4$$.