TITLE: Square of a second derivative is the fourth derivative
QUESTION [16 upvotes]: I have a simple question for you guys, if I have this:
$$\left(\frac{d^2}{{dx}^2}\right)^2$$
Is it equal to this:
$$\frac{d^4}{{dx}^4}$$
Such that if I have an arbitrary function $f(x)$ I can get:
$$\left(\frac{d^2 f(x)}{{dx}^2}\right)^2 = \frac{d^4 f(x)}{{dx}^4}$$
Sorry if it's a pretty simple question, but I was trying to simplify something like this:
$$\left(a \cdot \frac{d^2}{{dx}^2} - f(x)\right)^2 g(x)$$ that's where it came up.

REPLY [2 votes]: It turns out that the first fact you cited actually does apply.
The difficulty appears to be confusion between the expressions
$\left(a \cdot \frac{d^2}{{dx}^2} - f(x)\right)^2$
and $\left(a \cdot \frac{d^2}{{dx}^2} f(x)\right)^2$
The expression in parentheses has two terms, and expands like this:
\begin{align}
\left(a \frac{d^2}{{dx}^2} - f(x)\right)^2 g(x)
&= \left(a \frac{d^2}{{dx}^2} - f(x)\right)
  \left(a \frac{d^2}{{dx}^2} - f(x)\right) g(x) \\
&= \left(a \frac{d^2}{{dx}^2} - f(x)\right)
  \left(a \frac{d^2}{{dx}^2} g(x)- f(x)g(x)\right)  \\
&= a \frac{d^2}{{dx}^2} \left(a \frac{d^2}{{dx}^2} g(x)- f(x)g(x)\right)
  - f(x)\left(a \frac{d^2}{{dx}^2} g(x)- f(x)g(x)\right) \\
&= a^2 \frac{d^4}{{dx}^4} g(x) - a \frac{d^2}{{dx}^2} \left(f(x)g(x)\right)
  - a f(x) \frac{d^2}{{dx}^2} g(x) +  (f(x))^2 g(x)
\end{align}