# Water wave packet variance

Consider the following quantity,

$$I = \int x^2|\eta(x)|^2 \ dx,$$.

For $\eta(x)$ a solution to some linear equation, we have

$\eta(x) = \int a(k) e^{ikx} \ dk$ where, for $\eta$ to be real, we have $a(-k) = a^*(k)$.

Therefore, the integral $I$ becomes

$$I = \int\int a(k)a^*(k')\left(\int_{-\infty}^{\infty} x^2 e^{i(k-k')x}\ dx\right) \ dk dk'$$.

Now, the term in parenthesis can be found to be $-\delta''(k-k')$ where $\delta$ is the dirac delta function and primes are differentiation w.r.t $k$. Therefore, $I$ becomes

$$I=-\int a(k')\left(\frac{\partial^2}{\partial k^2} a(k)\right) \ dk$$.

Now, consider a wave packet defined as $$a(k) =S/k\quad k\in(k_o-dk/2,k_o+dk/2),$$ and zero otherwise, $S$ is a constant, $dk$ is the bandwidth and $k_o$ is some central wavenumber.

Now, if I substitute this into the last equation for $I$, this yields a negative number, which is absurd since $I$ is a positive definite integral.

What am I missing?

In your third equation, I think you have $$I=\int \bar{a}(k)\bigl(-\Delta_k\bigr) a(k) dk\; ,$$ where I have rewritten the second derivative as the Laplace operator and corrected tha missing complex conjugate and the fact that you have only one variable.
Said that, this can be rewrittenas the scalar product in $L^2$: $$I= \langle a, -\Delta_k a\rangle =\lVert \partial_k a\rVert^2$$ that is always positive.
A simpler way of seeing that is: $$I=\int x^2\lvert\eta(x)\rvert^2dx <+\infty \Rightarrow \lVert x \eta(x)\rVert_{L^2}< +\infty$$ i.e. $x\eta(x)\in L^2(\mathbb{R})$. Now the Fourier transform $\mathscr{F}$ is unitary on $L^2$, i.e. preserves the norm, and $\mathscr{F}[x\eta(x)]=-i\partial_k \mathscr{F}[\eta](k)$. So you obtain the equality: $$\lVert x \eta(x)\rVert_{L^2_x}^2=\lVert \mathscr{F}[x \eta(x)](k)\rVert_{L^2_k}^2=\lVert -i\partial_k \mathscr{F}[\eta](k)\rVert_{L^2_k}^2=\lVert\partial_k a(k)\rVert_{L^2_k}^2$$ with your notation of the Fourier transform of $\eta$.