Consider the nonlinear Schrödinger equation (I would like to do this for a more complicated set of equations, but to gain understanding I'll consider this simplified case)
$$A_t+iA_{xx}+i|A|^2A =0,$$
where $A=A(x,t)$ is a complex valued function.
One can calculate several conservation laws by looking at the obvious symmetries of its associated action. For instance, we have
$$\frac{\partial |A|^2}{\partial t} +\frac{\partial P}{\partial x} = 0$$
where $$P=i(A^*A_x-AA^*_x)$$
Let's say I wanted to check my variational calculus, and make sure this is in fact true, how would I go about doing this in Mathematica?
$\textbf{EDIT}$: I suppose I'll give some code, to try to provoke some interest.
When solving a simple conservation law $f_t+f_x=0$, the following seems to work
FullSimplify[D[f[x, t], t] + D[f[x, t], x],
Assumptions -> {D[f[x, t], t] == -D[f[x, t], x]}]
However, when I try something comparable for the conservation law given above, e.g.
FullSimplify[
D[u[x, t]^2 + v[x, t]^2, t] -
2 (u[x, t]*D[v[x, t], x] + v[x, t]*D[u[x, t], x]),
Assumptions -> {D[u[x, t],
t] == -(D[u[x, t], x, x] + (u[x, t]^2 + v[x, t]^2)*u[x, t]),
D[v[x, t],
t] == -(D[v[x, t], x, x] + (u[x, t]^2 + v[x, t]^2)*v[x, t])}]
where I've written $A=u+iv$, for $u,v$ real functions. This doesn't yield any type of simplification. In fact it just returns
2 (v[x,t] ((v^(0,1))[x,t]-(u^(1,0))[x,t])+u[x,t] ((u^(0,1))[x,t]-(v^(1,0))
[x,t]))
i.e. no simplification.
$\textbf{Edit 2}$: My algebra was incorrect, this method works in Mathematica using Assumptions.
FullSimplify[
D[u[x, t]^2 + v[x, t]^2, t] -
2 D[(u[x, t]*D[v[x, t], x] - v[x, t]*D[u[x, t], x]), x],
Assumptions -> {D[u[x, t],
t] == (D[v[x, t], x, x] + (u[x, t]^2 + v[x, t]^2)*v[x, t]),
D[v[x, t],
t] == -(D[u[x, t], x, x] + (u[x, t]^2 + v[x, t]^2)*u[x, t])}]