I'm currently reading Blundell and Lancaster's "Quantum Field Theory for the Gifted Amateur."
In chapter 1, example 1.4, they talk about how the action and Lagrangian density ideas are super helpful. It goes like:
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Consider a string.
Mass $m$.
Length $l$.
Thus we have a mass density of $l$.
Let $\mathcal{T}$ denote tension.
Let $\psi (x,t)$ be the function that describes the displacement of the rope.
Total kinetic energy is given by the integral $T=\frac{1}{2}\int_{0}^{L} dx\;\rho \left( \frac{\partial \psi }{\partial t} \right) ^2 $.
And potential by $V=\frac{1}{2}\int_{0}^{l} dx\;\mathcal{T} \left( \frac{\partial \psi }{\partial x} \right) ^2 $.
The action is then
\begin{align*} S \left[ \psi (x,y) \right] &= \int dt\;L \\ &= \int dt\;(T-V)\\ &= \int dt\;dx\;\mathcal{L} \left( \psi ,\frac{\partial \psi }{\partial t},\frac{\partial \psi }{\partial x} \right) \end{align*}
Here, the Lagrangian density is
$$\mathcal{L}\left( \psi ,\frac{\partial \psi }{\partial t},\frac{\partial \psi }{\partial x} \right)=\frac{\rho }{2} \left( \frac{\partial \psi }{\partial t} \right) ^2 -\frac{\mathcal{T}}{2} \left( \frac{\partial \psi }{\partial x} \right) ^2 $$
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
My question: After that, they proceed to take $\frac{\delta S}{\delta \psi }$ and show that
$$\frac{\delta S}{\delta \psi }=\frac{\partial \mathcal{L}}{\partial \psi }-\frac{d}{dx}\frac{\partial \mathcal{L}}{\partial (\partial \psi /\partial x)}-\frac{d}{dt}\frac{\partial \mathcal{L}}{\partial (\partial \psi /\partial t)}\tag{i}$$
Which then leads to the wave equation. But, how was that result (i) obtained?
UPDATE: For anyone reading this question in the future, as shared by Níckolas Alves, Nivaldo Lemos' book "Analytical Mechanics" goes through all of this at the beginning of chapter 11. He develops the general picture and then applies it to the wave equation in the first example.