Skip to content

A Hamiltonian field equation replaces the gradient of an ordinary function by the variational derivative of a functional. Integration by parts makes this replacement possible, but it also exposes boundary assumptions. We derive a periodic KdV equation from its Hamiltonian, test a variable-coefficient differential bracket, and show why a formal Hamiltonian representation does not by itself prove that a PDE has a well-posed evolution.

Required background. Integration by parts and the finite-dimensional rule z˙=P∇H\dot z=P\nabla H from Poisson brackets and Hamiltonian flows.

Helpful background. Continuity equations and boundary flux distinguishes a local conservation identity from conservation of an integrated charge.

Initially let u(x)u(x) be a real, smooth, periodic field of period L>0L\gt0. Variations v(x)v(x) are smooth and periodic too. A local functional has the form

F[u]=∫0Lf(x,u,ux,…,u(r)) dx,F[u]=\int_0^L f(x,u,u_x,\ldots,u^{(r)})\,dx,

where the explicit xx dependence is also periodic. The density depends on finitely many derivatives; “local” does not mean that the integral is concentrated at one spatial point.

The first variation is the linear functional

DF[u](v)=ddε∣ε=0F[u+εv].DF[u](v)=\left.\frac{d}{d\varepsilon}\right|_{\varepsilon=0} F[u+\varepsilon v].

When integration by parts removes derivatives from vv, define the variational derivative by

DF[u](v)=∫0LδFδu(x)v(x) dx.DF[u](v)=\int_0^L\frac{\delta F}{\delta u}(x)v(x)\,dx.

For a local density,

δFδu=∑j=0r(−∂x)j∂f∂u(j).\frac{\delta F}{\delta u} =\sum_{j=0}^{r}(-\partial_x)^j \frac{\partial f}{\partial u^{(j)}}.

The derivatives in this formula act on the entire coefficient to their right, including explicit xx dependence. The algebraic version treats densities modulo total derivatives; see De Sole, Kac and Valeri 2023, § 3, definition of the variational derivative. Here periodic integration supplies a concrete realization of that quotient.

Adding ∂xg\partial_x g to a periodic density leaves its functional unchanged. Thus functional densities are not unique. Conversely, changing a density by a term that is only claimed to be a total derivative should be checked by differentiating it.

A squared derivative with a variable coefficient

Section titled “A squared derivative with a variable coefficient”

Let a(x)a(x) be a prescribed smooth periodic function and VV a smooth function of one real variable. Consider

H[u]=∫0L[12a(x)ux2+V(u)]dx.H[u]=\int_0^L \left[\frac12a(x)u_x^2+V(u)\right]dx.

Direct differentiation gives

DH[u](v)=∫0L[auxvx+V′(u)v]dx.DH[u](v)=\int_0^L \left[a u_xv_x+V'(u)v\right]dx.

Before imposing any boundary condition, integration by parts gives

DH[u](v)=[auxv]0L+∫0Lb v dx,b=−∂x(aux)+V′(u).\begin{aligned} DH[u](v)&=[a u_xv]_0^L+\int_0^L b\,v\,dx,\\ b&=-\partial_x(a u_x)+V'(u). \end{aligned}

Periodicity cancels the boundary contribution, so

δHδu=−auxx−a′ux+V′(u).\frac{\delta H}{\delta u} =-a u_{xx}-a'u_x+V'(u).

The −a′ux-a'u_x term is essential. Treating the coefficient as a constant would vary a different functional.

On a finite interval with fixed endpoint values for uu, admissible variations satisfy v(0)=v(L)=0v(0)=v(L)=0, so the same bulk derivative is valid. With freely varying endpoints, the displayed boundary term remains part of the variation; stationary points must also obey the appropriate natural boundary conditions. A bulk Euler–Lagrange expression does not decide which endpoint problem was posed.

A differential operator defines a candidate bracket

Section titled “A differential operator defines a candidate bracket”

For sufficiently regular local functionals, write Fu=δF/δuF_u=\delta F/\delta u. Let JJ be a differential operator acting on periodic test functions and define

{F,G}=∫0LFu JGu dx.\{F,G\}=\int_0^L F_u\,J G_u\,dx.

Our evolution convention is

dFdt={F,H},ut=JHu.\frac{dF}{dt}=\{F,H\}, \qquad u_t=JH_u.

The second formula follows by testing against arbitrary linear functionals Fϕ[u]=∫ϕu dxF_\phi[u]=\int\phi u\,dx with smooth periodic ϕ\phi.

A necessary condition for antisymmetry is formal skew-adjointness:

∫0LϕJψ dx=−∫0LψJϕ dx.\int_0^L\phi J\psi\,dx =-\int_0^L\psi J\phi\,dx.

Boundary terms must vanish in the chosen class. Skew-adjointness is not the Jacobi identity; both are needed for a Poisson bracket. The corresponding algebraic distinction is explicit in De Sole, Kac and Valeri 2023, § 2, discussion following equation (2.8).

That source writes the functional bracket in the opposite order and evolves an observable by placing the Hamiltonian first. We reverse both conventions. With JJ identified with their Hamiltonian operator, the actual field equation ut=JHuu_t=JH_u is unchanged; see their § 4, equations (4.2), (4.4) and (4.5).

The simplest example is J=∂xJ=\partial_x. It is skew-adjoint on the circle:

∫0Lϕψx dx=−∫0Lϕxψ dx.\int_0^L\phi\psi_x\,dx =-\int_0^L\phi_x\psi\,dx.

It is also independent of the field uu. To see the significance of that fact, write the L2L^2 pairing as ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle and let F′′F'' denote the linearization of FuF_u. Equality of second variations makes F′′F'' formally self-adjoint. Differentiating the bracket yields

({F,G})u=F′′JGu−G′′JFu.(\{F,G\})_u=F''JG_u-G''JF_u.

Hence

{{F,G},K}=⟨F′′JGu,JKu⟩−⟨G′′JFu,JKu⟩.\{\{F,G\},K\} =\langle F''JG_u,JK_u\rangle -\langle G''JF_u,JK_u\rangle.

In the cyclic sum, the terms containing F′′F'' cancel because

⟨F′′JGu,JKu⟩=⟨F′′JKu,JGu⟩,\langle F''JG_u,JK_u\rangle =\langle F''JK_u,JG_u\rangle,

and similarly for G′′G'' and K′′K''. Thus Jacobi holds within the formal functional calculus.

This proof works for any fixed skew-adjoint operator on an admissible common class. If JJ depends on uu, differentiating it produces additional terms, and the proof no longer applies without checking them. In distribution notation the constant example is sometimes written

{u(x),u(y)}=∂xδL(x−y),\{u(x),u(y)\}=\partial_x\delta_L(x-y),

where δL\delta_L is the periodic delta distribution. Integrating this formula against two test functions reproduces ∫ϕψx dx\int\phi\psi_x\,dx; the sign of the delta derivative is fixed by that test.

Worked example: the first Hamiltonian bracket of KdV

Section titled “Worked example: the first Hamiltonian bracket of KdV”

Use dimensionless variables and choose

J=∂x,H[u]=∫0L(12ux2−u3)dx.J=\partial_x,\qquad H[u]=\int_0^L\left(\frac12u_x^2-u^3\right)dx.

The variation is

Hu=−uxx−3u2.H_u=-u_{xx}-3u^2.

Consequently,

ut=∂x(−uxx−3u2)=−uxxx−6uux,u_t=\partial_x(-u_{xx}-3u^2) =-u_{xxx}-6uu_x,

or

ut+6uux+uxxx=0.u_t+6uu_x+u_{xxx}=0.

This fixes the sign and scaling of the KdV equation on this page. The source’s alternative KdV normalization is stated in De Sole, Kac and Valeri 2023, § 4, equation (4.6) and the discussion after (4.7); its coefficients should not be imported without translating the field and Hamiltonian.

Three checks explain the construction.

First, HH is conserved along any sufficiently smooth periodic solution:

dHdt=∫0LHu∂xHu dx=12[Hu2]0L=0.\frac{dH}{dt} =\int_0^L H_u\partial_xH_u\,dx =\frac12[H_u^2]_0^L=0.

Second, the mass

C[u]=∫0Lu dxC[u]=\int_0^L u\,dx

has derivative Cu=1C_u=1 and satisfies JCu=0JC_u=0. It is a Casimir of this bracket, so it commutes with every admissible functional, not just this KdV Hamiltonian.

Third,

P[u]=12∫0Lu2 dxP[u]=\frac12\int_0^L u^2\,dx

has Pu=uP_u=u and generates ut=uxu_t=u_x. Its flow is u(x,t)=u(x+t,0)u(x,t)=u(x+t,0): translation of the argument. For the KdV Hamiltonian,

dPdt=−∫0L(uuxxx+6u2ux) dx=0\frac{dP}{dt} =-\int_0^L(u u_{xxx}+6u^2u_x)\,dx=0

by periodic integration by parts. Unlike CC, PP is not a Casimir; it generates a nonzero motion.

These are consistency checks of a Hamiltonian representation. They do not yet produce the full KdV hierarchy, establish independent infinitely many charges, or reconstruct a solution from initial data.

A variable coefficient tests skew-adjointness

Section titled “A variable coefficient tests skew-adjointness”

Suppose a proposed bracket uses J0=a(x)∂xJ_0=a(x)\partial_x. Its formal adjoint is

J0∗=−a∂x−a′,J_0^*=-a\partial_x-a',

because differentiation also hits aa. Unless a′a' vanishes, J0J_0 is not skew-adjoint. In fact,

∫ϕJ0ϕ dx=−12∫a′ϕ2 dx\int\phi J_0\phi\,dx =-\frac12\int a'\phi^2\,dx

on the circle.

For a nonzero check, take period 2π2\pi,

a(x)=2+sin⁡x,ϕ(x)=1+cos⁡x.a(x)=2+\sin x,\qquad \phi(x)=1+\cos x.

With Fϕ[u]=∫ϕu dxF_\phi[u]=\int\phi u\,dx,

{Fϕ,Fϕ}J0=−12∫02πcos⁡x(1+cos⁡x)2 dx=−π.\{F_\phi,F_\phi\}_{J_0} =-\frac12\int_0^{2\pi}\cos x(1+\cos x)^2\,dx =-\pi.

A bracket of a functional with itself cannot equal −π-\pi in a Poisson algebra. Positivity of aa does not repair this failure.

The corrected fixed operator

J=a∂x+12a′J=a\partial_x+\frac12a'

satisfies J∗=−JJ^*=-J. Since aa is prescribed independently of uu, the preceding Hessian argument also verifies formal Jacobi. Replacing a(x)a(x) by an arbitrary field-dependent coefficient is a different proposal and needs its own calculation.

A field-dependent bracket that can be straightened

Section titled “A field-dependent bracket that can be straightened”

Take a smooth, strictly positive periodic field uu. In the operator

Juϕ=u ∂x(uϕ)=u2ϕx+uuxϕ,J_u\phi=u\,\partial_x(u\phi) =u^2\phi_x+u u_x\phi,

the coefficient depends on the field being varied. Put w=log⁡uw=\log u. For any differentiable local functional FF, the variation δu=u δw\delta u=u\,\delta w gives Fw=uFuF_w=uF_u, where subscripts denote variational derivatives. Thus in the new coordinate the bracket becomes

∫FuJuGu dx=∫(uFu) ∂x(uGu) dx=∫Fw ∂xGw dx.\begin{aligned} \int F_u J_u G_u\,dx &=\int (uF_u)\,\partial_x(uG_u)\,dx\\ &=\int F_w\,\partial_x G_w\,dx. \end{aligned}

This proves formal Jacobi by reduction to the constant bracket on the same periodic domain. It also recovers the term uuxϕu u_x\phi that is lost if u2u^2 is simply placed in front of a derivative. This is the one-component, nondegenerate case of straightening a first-order bracket of hydrodynamic type. Dubrovin and Novikov, §I, Eqs. (2)–(3), Theorem 1 and its corollary, PDF.

Two tests are available in the original variable. First, ∫log⁡u dx\int\log u\,dx is a Casimir since Ju(1/u)=0J_u(1/u)=0. Second, choose

H=12∫(log⁡u)2 dx.H=\frac12\int(\log u)^2\,dx.

Then Hu=(log⁡u)/uH_u=(\log u)/u, so JuHu=uxJ_u H_u=u_x. Initial data u(x,0)=exp⁡(cos⁡x)u(x,0)=\exp(\cos x) evolve to u(x,t)=exp⁡(cos⁡(x+t))u(x,t)=\exp(\cos(x+t)) on the circle. Reversing the direction of translation would give the wrong sign. Both the coordinate proof and this Hamiltonian use strict positivity.

For a numerical check at t=0t=0, apply Ju=u ∂xuJ_u=u\,\partial_x u using a centered difference on a uniform periodic grid. Comparing the velocity at each node with −usin⁡x-u\sin x gives maximum errors of 0.0023410.002341, 0.00058540.0005854 and 0.00014640.0001464 on 64, 128 and 256 nodes. The approximate factor of four per refinement checks the derivative used in the calculation. Download the calculation in Python.

For smooth periodic fields, the integrations above are literal identities as long as the solution remains smooth. An analytic evolution theorem additionally needs a normed function space, a domain for the differential operator, existence, uniqueness, continuous dependence, and control of the lifespan. Conservation identities may help prove such results but do not supply them automatically.

Boundary conditions are equally substantive. On an interval, ∂x\partial_x is not skew-adjoint on an unrestricted collection of test functions. Nor does a boundary condition that makes one Hamiltonian differentiable automatically make every functional bracket admissible. Operator domains and boundary conditions develops the analogous issue for linear spectral operators. The nonlinear hierarchies and reconstruction methods belong to Solitons and Nonlinear Waves.

On the circle, let

F[u]=12∫0L(uxx2+m2u2) dx,m≥0.F[u]=\frac12\int_0^L(u_{xx}^2+m^2u^2)\,dx, \qquad m\ge0.

Find FuF_u and the equation generated by J=∂xJ=\partial_x.

Solution. Two integrations by parts give Fu=uxxxx+m2uF_u=u_{xxxx}+m^2u. Thus

ut=uxxxxx+m2ux.u_t=u_{xxxxx}+m^2u_x.

The fourth derivative in FuF_u has a plus sign because integration by parts was performed twice. Fourier modes also check it: ∂x4\partial_x^4 has eigenvalue k4k^4.

2. The boundary obstruction made numerical

Section titled “2. The boundary obstruction made numerical”

On [0,L][0,L], apply the unrestricted candidate bracket with J=∂xJ=\partial_x to

F[u]=∫0Lu dx,G[u]=∫0Lxu dx.F[u]=\int_0^L u\,dx,\qquad G[u]=\int_0^L xu\,dx.

What fails?

Solution. Since Fu=1F_u=1 and Gu=xG_u=x,

{F,G}=∫0L1 dx=L,{G,F}=0.\{F,G\}=\int_0^L1\,dx=L,\qquad \{G,F\}=0.

Their sum is the endpoint term [x]0L[x]_0^L. The unrestricted proposal is not antisymmetric. The test xx is not periodic, so this does not contradict the circle calculation.

3. Verify the variable-coefficient variation

Section titled “3. Verify the variable-coefficient variation”

Take a=2+sin⁡xa=2+\sin x, V(u)=u4/4V(u)=u^4/4 and u=cos⁡xu=\cos x on the 2π2\pi circle. Evaluate HuH_u explicitly.

Solution. Using ux=−sin⁡xu_x=-\sin x and uxx=−cos⁡xu_{xx}=-\cos x,

Hu=(2+sin⁡x)cos⁡x+cos⁡xsin⁡x+cos⁡3x=2cos⁡x+2sin⁡xcos⁡x+cos⁡3x.\begin{aligned} H_u&=(2+\sin x)\cos x\\ &\quad+\cos x\sin x+\cos^3x\\ &=2\cos x+2\sin x\cos x+\cos^3x. \end{aligned}

Omitting a′uxa'u_x would lose one sin⁡xcos⁡x\sin x\cos x term. An independent check is to differentiate H[u+εv]H[u+\varepsilon v] at zero and compare with ∫Huv dx\int H_uv\,dx for several periodic test functions vv.

  • De Sole, Alberto, Victor G. Kac, and Daniele Valeri. “Poisson vertex algebras and Hamiltonian PDE.” Contribution to the second edition of Encyclopedia of Mathematical Physics, preprint version, 2023. arXiv:2306.09709v1. Versioned full text.
  • Dubrovin, B. A., and S. P. Novikov. “Hamiltonian formalism of one-dimensional systems of hydrodynamic type, and the Bogolyubov–Whitham averaging method.” Doklady Akademii Nauk SSSR 270 (1983), 781–785. Journal record. Author’s English text, PDF.