Change of variables in partial derivative I am stuck on a simple exercise in quantum mechanics because I can't figure out how to modify a partial derivative under a change in variables. If I have a Hamiltonian in two variables $x_1$ and $x_2$, and I introduce two new variables $u = x_1 - x_2$ and $v = x_1+x_2$, how to I change the partial derivatives $\frac{\partial^2}{\partial x_1^2}$ and $\frac{\partial^2}{\partial x_2^2}$ to be expressed in terms of $u$ and $v$?
I have the following Hamiltonian:
$$
H = - \frac{\hbar^2}{2m} \frac{\partial^2}{\partial x_1^2} -  \frac{\hbar^2}{2m} \frac{\partial^2}{\partial x_2^2} + \frac{1}{2}m\omega^2 x_1^2 + \frac{1}{2}m\omega^2 x_1^2 + \frac{1}{2}\epsilon(x_1-x_2)^2 
$$
I tried a change of variables $u = x_1-x_2$ and $v  =x_1+x_2 $. The potential part of the Hamiltonian becomes
$$
\frac{1}{4}m\omega^2 (u^2+v^2) + \frac{1}{2}\epsilon u^2
$$
My question is what happens to the kinetic part, $- \frac{\hbar^2}{2m} \frac{\partial^2}{\partial x_1^2} -  \frac{\hbar^2}{2m} \frac{\partial^2}{\partial x_2^2}$? How do these derivative change under this transformation?
 A: We have
$$
\frac{\partial f}{\partial x_1}=\frac{\partial f}{\partial u}\frac{\partial u}{\partial x_1}+\frac{\partial f}{\partial v}\frac{\partial v}{\partial x_1}
$$
and so
$$
\frac{\partial }{\partial x_1}=\frac{\partial u}{\partial x_1}\frac{\partial }{\partial u}+\frac{\partial v}{\partial x_1}\frac{\partial }{\partial v}=\frac{\partial }{\partial u}+\frac{\partial }{\partial v}.
$$
You can proceed similarly for ${\partial f}/{\partial x_2}$.
For the second derivatives you apply this procedure twice:
$$
\begin{split}
\frac{\partial^2 f}{\partial x_1^2}
&=\frac{\partial}{\partial x_1}\left(\frac{\partial f}{\partial u}\frac{\partial u}{\partial x_1}+\frac{\partial f}{\partial v}\frac{\partial v}{\partial x_1}\right)=\frac{\partial}{\partial x_1}\left(\frac{\partial f}{\partial u}+\frac{\partial f}{\partial v}\right)\\
&=\frac{\partial^2 f}{\partial u^2}\frac{\partial u}{\partial x_1}
+\frac{\partial^2 f}{\partial u\partial v}\frac{\partial v}{\partial x_1}
+\frac{\partial^2 f}{\partial v\partial u}\frac{\partial u}{\partial x_1}
+\frac{\partial^2 f}{\partial v^2}\frac{\partial v}{\partial x_1}\\
&=\frac{\partial^2 f}{\partial u^2}
+2\frac{\partial^2 f}{\partial u\partial v}
+\frac{\partial^2 f}{\partial v^2},
\end{split}
$$
assuming that $f$ is $C^2$. So
$$
\frac{\partial^2}{\partial x_1^2}
=\frac{\partial^2}{\partial u^2}
+2\frac{\partial^2}{\partial u\partial v}
+\frac{\partial^2}{\partial v^2}.
$$
Again you can proceed similarly for ${\partial^2 f}/{\partial x_2^2}$.
A: I'll add a note about how I keep myself from getting confused in these situations (where abuse of notation is rife), after enforcing the change of coordinates
$$
(x_1,x_2)\mapsto (u,v)
$$
we rewrite ($C^2$) functions 
$
f(x_1,x_2)
$
as 
$$
f(x_1,x_2)=g(u(x_1,x_2),v(x_1,x_2))
$$
Then let's figure out what the familiar partials are in terms of the new partials,
$$
f_{x_1^2}=g_{u^2}+2g_{uv}+g_{v^2}\\
f_{x_1^2}=g_{u^2}-2g_{uv}+g_{v^2}
$$
by the same computation as in the other answer. Since this holds for any (sufficiently nice) function $f$ we transform, we have
$$
\partial_{x_1}^2=\partial_{u^2}+2\partial_{uv}+\partial_{v^2}\\
\partial_{x_2}^2=\partial_{u^2}-2\partial_{uv}+\partial_{v^2}
$$
A: I know this is an old question, but for future passer-by I'd like to point out that it is actually a very useful exercise that helps to understand (reduced) density matrices in 1st quantised formalism. See (Peschel 1999): https://arxiv.org/abs/cond-mat/9906224
Consider a purely bosonic model, a chain of $L$ harmonic oscillator with frequency  $\omega_0$, coupled together by springs. It has a gap in the phonon spectrum and is a non-critical integrable system. The Hamiltonian reads
\begin{equation}
 H = \sum_{i=1}^L \left( -\frac{1}{2} \frac{\partial ^2}{\partial x_i^2} + \frac{1}{2} \omega_0^2 x_i^2 \right)   + \sum_{i=1}^{L-1} \frac{1}{2}\kappa(x_{i+1} - x_i)^2 
\end{equation}
Peschel parameterized it by $\omega_0 = 1 - \kappa$, so that if $\kappa = 0$ the Hamiltonian is digonal under boson occupation number, and there is no dispersion (only one mode $\omega_0$) and the system is gapped. If $\kappa \rightarrow 1$ (thus $\omega_0 \rightarrow 0$), there will only be acoustic phonon excitations and the system become gapless.
As the simplest example let us scrutinize the 2-particle problem. Its Hamiltonian reads
\begin{equation}
 H = \frac{1}{2} \frac{\partial^2 }{\partial x_1^2} + \frac{1}{2} \frac{\partial ^2}{\partial x_2^2} + \frac{1}{2}\omega_0^2 x_1^2 + \frac{1}{2} \omega_0^2 x_2^2 + \frac{\kappa}{2}(x_1 - x_2)^2
\end{equation}
We don't want off-diagonal terms like $x_1 - x_2$, so we do the following transformation:
\begin{equation}
 v = (x_1 + x_2)/\sqrt{2},\;\;u = (x_1 - x_2)/\sqrt{2}\;\;\iff\;\; x_1 =  (v + u)/\sqrt{2},\;\; x_2 = (v - u)/\sqrt{2}
\end{equation}
I like the factor of $\sqrt{2}$ because of its reciprocal symmetry (also the transformation belongs to $O(2)$ so that $\sum_{i} x_i^2$ remain the same form). Then the potential energy becomes
\begin{equation}
 \frac{1}{2} \omega_0 x_1^2 + \frac{1}{2}\omega_0 x_2^2 + \frac{\kappa}{2} (x_1 - x_2)^2 = \frac{1}{2}\omega_0 v^2 + \frac{1}{2} \omega_0 u^2 + \frac{\kappa}{4} u^2
\end{equation}
Now one question worthy of asking is how this transformation affect momentum terms?
\begin{equation}
 \frac{\partial }{\partial x_1}=\frac{\partial u}{\partial x_1}\frac{\partial }{\partial u}+\frac{\partial v}{\partial x_1}\frac{\partial }{\partial v}=\frac{1}{\sqrt{2}}\left(\frac{\partial }{\partial u}+\frac{\partial }{\partial v}\right)
\end{equation}
\begin{equation}
 \frac{\partial }{\partial x_2}=\frac{\partial u}{\partial x_2}\frac{\partial }{\partial u}+\frac{\partial v}{\partial x_2}\frac{\partial }{\partial v}= \frac{1}{\sqrt{2}}\left(-\frac{\partial }{\partial u}+\frac{\partial }{\partial v}\right)
\end{equation}
so the second derivative gives
\begin{equation}
\begin{split}
 2\frac{\partial ^2}{\partial x_1^2} &= \sqrt{2}\frac{\partial }{\partial x_1} \left( \frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right) = \left( \frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right)\left( \frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right) \\
        &= \frac{\partial ^2}{\partial u^2} + 2 \frac{\partial ^2}{\partial u \partial v} + \frac{\partial ^2}{\partial v^2}
\end{split} 
\end{equation}
\begin{equation}
\begin{split}
 2\frac{\partial ^2}{\partial x_2^2} &= \sqrt{2}\frac{\partial }{\partial x_2} \left( -\frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right) = \left( -\frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right)\left( -\frac{\partial }{\partial u} + \frac{\partial }{\partial v}\right) \\
        &= \frac{\partial ^2}{\partial u^2} - 2 \frac{\partial ^2}{\partial u \partial v} + \frac{\partial ^2}{\partial v^2}
\end{split} 
\end{equation}
So the kinetic term after transformation is
\begin{equation}
 \frac{1}{2}\frac{\partial ^2}{\partial x_1^2} + \frac{1}{2} \frac{\partial ^2}{\partial x_2^2} = \frac{1}{2}\frac{\partial ^2}{\partial u^2} + \frac{1}{2} \frac{\partial ^2}{\partial v^2}
\end{equation}
which is of the same form! We can actually understand this intuitively by perceiving the Hamiltonian as a single oscillator in a 2D plane with $x_1$ and $x_2$ standing for the two axes. The symmetric matrix is orthogonally diagonalizable, which is essentially a rotation of axes, thus shouldn't change the form of momentum. Then the original Hamiltonian is rotated into
\begin{equation}
 H = \frac{1}{2} \frac{\partial ^2}{\partial u^2} + \frac{1}{2}\left( \omega_0^2 + \frac{\kappa}{2} \right)u^2 + \frac{1}{2} \frac{\partial ^2}{\partial v^2} + \frac{1}{2}\omega_0^2 v^2 \equiv H_u + H_v
\end{equation}
which describes two de-coupled harmonic oscillators. Since $[H, H_u] = [H, H_v] = [H_u, H_v] = 0$, wavefunctions of two harmonic modes can be measured simultanously, and their corresponding wavefunctions become separable. The ground state of a 1D harmonic oscillator with angular frequency $\omega$ is
\begin{equation}
 \Psi(x) = \left( \frac{\omega}{\pi} \right)^{1/4}\exp(-\frac{\omega}{2} x^2) \exp(-i\frac{\omega}{2}t)
\end{equation}
therefore, if define $\Omega^2 \equiv (1/2)(\omega_0^2 + \kappa/2)$,  the joint wavefunction of normal modes is
\begin{equation}
 \Psi(u,v) = C \exp(-\frac{\Omega}{2}u^2-\frac{\omega_0}{2}v^2)
\end{equation}
where $C$ is a normalization constant. Then following Peschel1999 you can derive the reduced density matrix for a single oscillator.
