I have the following Lagrangian density $\mathcal{L}$ where
$$ \mathcal{L}=\frac{1}{2}\left(c[\partial_{t}\phi(x,t)]^{2}-\frac{1}{l}[\partial_{x}\phi(x,t)]^{2}+\frac{1}{\omega_{J}^{2}l}[\partial_{x}\partial_{t}\phi(x,t)]^{2}+\gamma[\partial_{x}\phi(x,t)]^{4}\right)\tag{1} $$
where $c,l,\omega_{J},\gamma$ are constants. Defining the usual conjugate momenta $\pi$ such that $$ \pi=\frac{\partial\mathcal{L}}{\partial(\partial_{t}\phi(x,t))}.\tag{2} $$
How should I evaluate the third term $[\partial_{x}\partial_{t}\phi(x,t)]^{2}$ where there is also an $x$-derivative?
Edit: I found a solution to this. It seems that I cannot use the regular convention for defining conjugate momenta. Rather I have to define it such that $$ \pi=\frac{\delta\mathcal{L}}{\delta[\partial_{t}\phi]}=\frac{\partial\mathcal{L}}{\partial[\partial_{t}\phi]}-\partial_{x}\frac{\partial\mathcal{L}}{\partial[\partial_{x}\partial_{t}\phi]} = c\partial_{t}\phi-\frac{1}{\omega_{J}^{2}l}\partial_{x}^{2}\partial_{t}\phi.\tag{3} $$
I do not understand this definition of conjugate momenta. Can someone explain why is it defined like so?