logo for David Morrin

Changing variables

A note on transforming an expression given in the form

\[\int \left(\frac{d}{dx} (f \circ g)(x)\right) dx\]

to a form where both the differentiation operator and the differential are taken with respect to $g$, not $x$.

We can use the chain rule to change $\frac{d}{dx}$ into an expression with $\frac{d}{dg}$:

\[\frac{d}{dx} = \frac{dg}{dx}\cdot\frac{d}{dg}, \quad \text{for } \frac{dg}{dx} \ne 0\]

and we can change $dx$ into an expression with $dg$:

\[\frac{dg}{dx} = \frac{dg}{dx}\] \[dx\cdot\frac{dg}{dx} = dx \cdot \frac{dg}{dx}\] \[dx = \left(\frac{dg}{dx}\right)^{-1} dg.\]

Substituting into the original expression, we have

\[\int \underbrace{\frac{dg}{dx}\cdot\frac{d}{dg}}_{\text{from }\frac{d}{dx}} (f \circ g)(x) \underbrace{\left(\frac{dg}{dx}\right)^{-1}}_{\text{from } dx} dg\]

which could further simplify, but we’ll leave it there for now. (As is, the simplification cancels everything and just leads to $f$, which is not too interesting.)


For the second derivative version

\[\int \left(\frac{d^2}{dx^2} (f \circ g)(x)\right) dx\]

we have to compose two derivatives:

\[\frac{d^2}{dx^2} = \frac{dg}{dx}\cdot\frac{d}{dg}\left[\frac{dg}{dx}\cdot\frac{d}{dg}\right], \quad \text{for } \frac{dg}{dx} \ne 0\] \[\int \underbrace{\frac{dg}{dx}\cdot\frac{d}{dg}\left[\frac{dg}{dx}\cdot\frac{d}{dg}(f \circ g)(x)\right]}_{\text{from }\frac{d^2}{dx^2}} \underbrace{\left(\frac{dg}{dx}\right)^{-1}}_{\text{from } dx} dg.\]

Example

This came up while working out problem 2.11 from Introduction to Quantum Mechanics (3rd ed.) by Griffiths and Schroeter.

In this problem we get an integral with the form

\[\int (f \circ g)(x) \left(\frac{d^2}{dx^2} (f \circ g)(x)\right) dx\]

where $g=\xi(x)$ and $(f \circ g) = e^{-\frac{1}{2}\xi^2}$ for $\psi_0$ and $(f \circ g) = \sqrt{\frac{\hbar}{m\omega}}\xi e^{-\frac{1}{2}\xi^2}$ for $\psi_1$.

Problem

Compute $\langle p^2 \rangle$ for $\psi_0=\alpha e^{-\frac{1}{2}\xi^2}dx$ where $p$ is the momentum operator, $\langle p^2 \rangle$ is the expectation value of the momentum, and $\psi_0$ is the wave function for a quantum harmonic oscillator (the wave function solved for $V(x) = \frac{1}{2}m\omega^2 x^2$).

Given:

Calculation

Applying the definition of the expectation value of the momentum operator:

\[\langle p^2 \rangle = \int_{-\infty}^{\infty} \psi_0^* \left(-i\hbar \frac{d}{dx}\right)^2 \psi_0\; dx.\]

Since $i$ and $\hbar$ are constants with respect to $x$, we should simplify them to

\[(-i\hbar)^2 = i^2\hbar^2 = -\hbar^2\]

and factor them out. Substituting the definition of $\psi_0$ (note that $\psi_0^*=\psi_0$ in this case) we have

\[\langle p^2 \rangle = -\hbar^2 \alpha^2 \int_{-\infty}^{\infty} \underbrace{e^{\frac{-1}{2}\xi^2}}_{(f \circ g)(x)} \left(\frac{d^2}{dx^2} \underbrace{e^{\frac{-1}{2}\xi^2}}_{(f \circ g)(x)}\right) dx.\]

Now we can use the chain rule substitutions we figured out above if we first work out $\frac{d\xi}{dx}$ and its inverse:

\[\frac{d\xi}{dx} = \sqrt{\frac{m\omega}{\hbar}}, \quad \left(\frac{d\xi}{dx}\right)^{-1} = \sqrt{\frac{\hbar}{m\omega}}\]

and then our substitutions are

\[\langle p^2 \rangle = -\hbar^2 \alpha^2 \int_{-\infty}^{\infty} e^{\frac{-1}{2}\xi^2} \left(\textcolor{red}{ \sqrt{\frac{m\omega}{\hbar}} \cdot \frac{d}{d\xi} \bigg[ \sqrt{\frac{m\omega}{\hbar}} \cdot \frac{d}{d\xi}e^{\frac{-1}{2}\xi^2} \bigg] } \right) \textcolor{red}{\sqrt{\frac{\hbar}{m\omega}}\; d\xi}.\]

When we take the derivative of the exponential we get

\[\frac{d}{d\xi}e^{-\frac{1}{2}\xi^2}=-\frac{1}{2}\cdot 2\xi e^{-\frac{1}{2}\xi^2}=-\xi e^{-\frac{1}{2}\xi^2}.\]

In this next step we’ll do several actions at once:

\[\langle p^2 \rangle = \textcolor{red}{+}\hbar^2 \alpha^2 \textcolor{red}{\sqrt{\frac{m\omega}{\hbar}}} \int_{-\infty}^{\infty} e^{\frac{-1}{2}\xi^2} \frac{d}{d\xi} \textcolor{red}{\left(\xi e^{-\frac{1}{2}\xi^2}\right)}\; d\xi\]

and then apply the product rule:

\[\langle p^2 \rangle = \hbar^2 \alpha^2 \sqrt{\frac{m\omega}{\hbar}} \int_{-\infty}^{\infty} e^{\frac{-1}{2}\xi^2} \textcolor{red}{\left(e^{-\frac{1}{2}\xi^2}-\xi^2e^{-\frac{1}{2}\xi^2}\right)}\; d\xi\]

Distributing the $e^{-\frac{1}{2}\xi^2}$ makes two terms raised to a whole $\xi^2$ instead of half:

\[\langle p^2 \rangle = \hbar^2 \alpha^2 \sqrt{\frac{m\omega}{\hbar}} \int_{-\infty}^{\infty} \textcolor{red}{\left(e^{-\xi^2}-\xi^2e^{-\xi^2}\right)}\; d\xi\]

Recognizing that we have the sum of two integrals of an even function, symmetrical about the origin ($x=0$), we can use the relation

\[\int_{-\infty}^{\infty} y_{\text{even}}(x) dx = 2\int_0^{\infty} y_{\text{even}}(x) dx\]

to rewrite our single integral into a sum of integrals:

\[\langle p^2 \rangle = \textcolor{red}{2}\hbar^2 \alpha^2 \sqrt{\frac{m\omega}{\hbar}} \textcolor{red}{\left(\int_{0}^{\infty} e^{-\xi^2} d\xi -\int_{0}^{\infty}\xi^2e^{-\xi^2} d\xi \right)}.\]

Using the formula provided on the back cover of the book:

\[\int_0^{\infty} \xi^{2n} e^{-\frac{\xi^2}{a^2}} dx = \sqrt{\pi} \frac{(2n)!}{n!} \left(\frac{a}{2}\right)^{2n+1}\]

we have $a=1$ for both integrals and $n=0$ for the left term and $n=1$ for the right term, which simplify to $\frac{\sqrt{\pi}}{2}$ and $\frac{\sqrt{\pi}}{4}$ respectively.

Substituting the formula results and the definition of $\alpha$:

\[\langle p^2 \rangle = 2\hbar^2 \sqrt{\frac{m\omega}{\pi \hbar}} \textcolor{red}{\sqrt{\frac{m\omega}{\hbar}}} \textcolor{red}{ \left( \frac{\sqrt{\pi}}{2} -\frac{\sqrt{\pi}}{4} \right) }\] \[\langle p^2 \rangle = \frac{2}{\textcolor{red}{4}}\hbar^2 \textcolor{red}{\sqrt{\frac{m^2\omega^2 \pi}{\pi\hbar^2}}}\] \[\langle p^2 \rangle = \textcolor{red}{\frac{1}{2}}\hbar^2 \textcolor{red}{\frac{m\omega}{\hbar}}\] \[\boxed{\langle p^2 \rangle = \frac{\hbar m \omega}{2}}\]

If we do that all over again for $\psi_1=\alpha \sqrt{\frac{2m\omega}{\hbar}}x e^{-\frac{1}{2}\xi^2}$:

\[\langle p^2 \rangle = \int_{-\infty}^{\infty} \psi_1^* \left(-i\hbar \frac{d}{dx}\right)^2 \psi_1\; dx\] \[\langle p^2 \rangle = -\hbar^2 \alpha^2 \frac{2m\omega}{\hbar}\int_{-\infty}^{\infty} xe^{-\frac{1}{2}\xi^2} \frac{d^2}{dx^2} xe^{-\frac{1}{2}\xi^2} dx\]

First we can replace $x$ in terms of $\xi$:

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \int_{-\infty}^{\infty} \underbrace{\textcolor{red}{\sqrt{\frac{\hbar}{m \omega}}\xi}}_{x} e^{-\frac{1}{2}\xi^2} \frac{d^2}{dx^2} \underbrace{\textcolor{red}{\sqrt{\frac{\hbar}{m \omega}}\xi}}_{x}e^{-\frac{1}{2}\xi^2} dx\]

and similarly replace $dx$ in terms of $d\xi$:

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \int_{-\infty}^{\infty} \sqrt{\frac{\hbar}{m \omega}}\xi e^{-\frac{1}{2}\xi^2} \underbrace{\textcolor{red}{\left(\frac{d\xi}{dx}\right)^2\cdot\frac{d^2}{d\xi^2} }}_{\frac{d^2}{dx^2}} \sqrt{\frac{\hbar}{m \omega}}\xi e^{-\frac{1}{2}\xi^2} \underbrace{\textcolor{red}{\sqrt{\frac{\hbar}{m\omega}} \; d\xi}}_{dx}.\]

Once we we clean up all the $\sqrt{\frac{m\omega}{\hbar}}$ and its inverse terms, we have

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \textcolor{red}{\left(\frac{\hbar}{m \omega}\right)^{3/2}} \int_{-\infty}^{\infty} \xi e^{-\frac{1}{2}\xi^2} \textcolor{red}{\left(\frac{m\omega}{\hbar}\right)}\cdot\frac{d^2}{d\xi^2} \xi e^{-\frac{1}{2}\xi^2} d\xi\]

and we’ve reached that point again where we can work the integral in terms of $\xi$:

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \textcolor{red}{\sqrt{\frac{\hbar}{m \omega}}} \int_{-\infty}^{\infty} \xi e^{-\frac{1}{2}\xi^2} \frac{d^2}{d\xi^2} \xi e^{-\frac{1}{2}\xi^2} d\xi.\]

Using the product rule,

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \int_{-\infty}^{\infty} \xi e^{-\frac{1}{2}\xi^2} \textcolor{red}{\frac{d}{d\xi} \left(e^{-\frac{1}{2}\xi^2}-\xi^2e^{-\frac{1}{2}\xi^2}\right)} d\xi\]

and then product rule again,

\[\langle p^2 \rangle = -2\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \int_{-\infty}^{\infty} \xi e^{-\frac{1}{2}\xi^2} \textcolor{red}{\left(-\xi e^{-\frac{1}{2}\xi^2}-\left(2\xi e^{-\frac{1}{2}\xi^2} - \xi^3 e^{-\frac{1}{2}\xi^2}\right)\right)} d\xi\]

factor out a negative sign,

\[\langle p^2 \rangle = \textcolor{red}{+}2\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \int_{-\infty}^{\infty} \xi e^{-\frac{1}{2}\xi^2} \left(\textcolor{red}{+}\xi e^{-\frac{1}{2}\xi^2}\textcolor{red}{+}2\xi e^{-\frac{1}{2}\xi^2} \textcolor{red}{-} \xi^3 e^{-\frac{1}{2}\xi^2}\right) d\xi\]

and distribute the first term under the integral

\[\langle p^2 \rangle = 2\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \int_{-\infty}^{\infty} \left(\textcolor{red}{\xi^2 e^{-\xi^2} + 2\xi^2 e^{-\xi^2} - \xi^4 e^{-\xi^2}}\right) d\xi.\]

Again we can recognize the even functions about the origin can have their limits changed and a factor of two comes out:

\[\langle p^2 \rangle = \textcolor{red}{4}\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \textcolor{red}{\left(\int_{0}^{\infty} \xi^2 e^{-\xi^2} d\xi +\int_{0}^{\infty} 2\xi^2 e^{-\xi^2}d\xi -\int_{0}^{\infty} \xi^4 e^{-\xi^2} d\xi\right)}.\]

Referring to our formula for gaussian integrals with $n=1$ and $n=2$, we have

\[\langle p^2 \rangle = 4\hbar m \omega \alpha^2 \sqrt{\frac{\hbar}{m \omega}} \textcolor{red}{\left(\frac{\sqrt{\pi}}{4} + \frac{2\sqrt{\pi}}{4} -\frac{3\sqrt{\pi}}{8}\right)}.\]

Time to expand $\alpha^2$ and do the final simplification:

\[\langle p^2 \rangle = 4\hbar m \omega \textcolor{red}{\sqrt{\frac{m\omega}{\pi\hbar}}} \sqrt{\frac{\hbar}{m \omega}} \textcolor{red}{\sqrt{\pi}\left(\frac{3}{8}\right)}\] \[\langle p^2 \rangle = \textcolor{red}{\frac{3}{2}}\hbar m \omega \textcolor{red}{\sqrt{\frac{m\omega}{\pi\hbar}} \sqrt{\frac{\hbar\pi}{m \omega}}}\] \[\boxed{\langle p^2 \rangle = \frac{3}{2}\hbar m \omega}\]