Unified action functional for charged particle in electromagnetic field and for field itself [duplicate]
I am joung mathematician and very new to physics, so my question might be vague.
I wonder whether there is a way to write down the unified action functional $S$ for coordinates of particle of charge $e$ and mass $m$ moving in electromagnetic field with potential $A_{\mu}$ and for this potential itself.
I want that applying Principle of Least Action ($\delta S = 0$) would give Maxwell Equations and Lorentz Force at the same time.
Lagrangian for particle:
$L = -mc \sqrt{\dot{x}^{\mu}\dot{x}{\mu}} - \frac{e}{c}\dot{x}^{\mu}A{\mu}$
It is obviously Lorentz invariant and it seems to give gauge invariant equations of motion (because correspondent Euler-Lagrange equations depend only on fields $\vec{E}$ and $\vec{H}$ which are gauge invariant).
Lagrangian density for potential:
$\mathcal{L} = -\frac{1}{16\pi c}F_{\mu \nu}F^{\mu \nu} -\frac{1}{c^2}A_{\mu}j^{\mu}$
where $F_{\mu \nu} = \partial_{\mu}A_{\nu} - \partial_{\nu}A_{\mu}$
It is Lorentz invariant and gives gauge invariant Maxwell equations as Euler-Lagrange equations.
I want to write something like
$S = \int_{t_0}^{t_1}\left(L + \int_{\mathbb{R}^3} \mathcal{L} d^3 x\right)dt$
Finally, my question is:
Will it work and how to understand this rigorously if it works?
I am asking this question because I messed up my reasoning by not understanding things like when and which variables should I consider as independent or dependent relatively to each other and so on. I want to drink your wisdom!