# Square of a second derivative is the fourth derivative

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.

• It is true that $$\left(\frac{d^2}{dx^2}\right)^2=\frac{d^4}{dx^4}$$ What is not true is that $$\left(\frac{d^2}{dx^2}\right)^2$$ acting on $f(x)$ gives you $$\left(\frac{d^2 f(x)}{dx^2}\right)^2$$ – Dylan Nov 23 '15 at 14:25
• The first thing you state is true. But this: $$\left(\frac{d^2 f(x)}{{dx}^2}\right)^2 = \frac{d^4 f(x)}{{dx}^4}$$ is false. It's about like asking if $g(g(x))=(g(x))^2$ in general. – Thomas Andrews Nov 23 '15 at 14:26
• @Dylan So regarding the binomial, I should first square it before letting it act on the function outside, giving me $\frac{d^4 g(x)}{{dx}^4}$ for the first term, or is it still wrong? – mopy Nov 23 '15 at 14:32
• @Aldon You have to be careful about how you square it, but otherwise yes, that should be fine. You can't use the "identity" that $(a+b)^2=a^2+2ab+b^2$, since that assumes that $a$ and $b$ commute, while it is not the case that $\frac{d^2}{dx^2}$ and $f(x)$ commute. – Dylan Nov 23 '15 at 14:35
• For anyone else who wondered what functions actually satisfy $f^{(2)}(x) = f^{(4)}(x)$, Wolfram Alpha gives the answer, in terms of the Weierstrass $\sigma$-function. I don’t know enough about differential equations to see how one might find that solution, other than by solving as a power series and recognising the result… Can anyone give a general heuristic that would cover this problem? – Peter LeFanu Lumsdaine Nov 24 '15 at 15:50

It depends on what you mean by "square" and it's basically a problem of notation. When you write $\left(\frac{d^2}{{dx}^2}\right)^2$, implicitly the "square" means that you compose the operator $\frac{d^2}{{dx}^2}$ with itself, i.e. you consider $\frac{d^2}{{dx}^2} \circ \frac{d^2}{{dx}^2}$. This is of course equal to $\frac{d^4}{{dx}^4}$: differentiating four times is the same thing as differentiating twice then differentiating twice again. Applied to some function $f$, this then gives $\frac{d^2}{{dx}^2} \left( \frac{d^2 f(x)}{{dx}^2} \right) = \frac{d^4 f(x)}{{dx}^4}$, which is true.

On the other hand, where you write $\left(\frac{d^2 f(x)}{{dx}^2}\right)^2$, the "square" is implicitly multiplication, i.e. you're considering $\left(\frac{d^2 f(x)}{{dx}^2}\right) \cdot \left(\frac{d^2 f(x)}{{dx}^2}\right)$. This is not equal to the first thing, as simple counterexamples show (e.g. $f(x) = x^3$: $f''(x) = 6x$ thus $(d^4f)/(dx^4)(x) = 0$ while $((d^2f)/(dx^2)(x))^2 = (6x)^2 = 36x^2$). So you need to be careful with your notations.

• It's worth to note that for linear operators like differentiation, composition is, in a pretty solid sense, a multiplication operation – most obvious to see if you approximate the domain to a finite-difference mesh, because then the differential operator is just a matrix. The only reason this leads to confusion is that people keep mixing up functions with values of functions: multiplying two operators and then applying them to some argument is not the same thing as first applying each operator individually and then multiplying the results. – leftaroundabout Nov 23 '15 at 20:48
• Of course, the way maths is usually written invites this kind of ambiguity. Especially unhelpful is ridiculous notation such as $\sin^2(x)$... – leftaroundabout Nov 23 '15 at 20:54
• $\frac{d}{dx}$ is a operator or operation of differentiation?....@leftaroundabout @Najib Idrissi – Sathasivam K Aug 27 '16 at 7:08

I'm afraid not. Consider calculating the two quantities for

$$f(x)=x^3.$$

• So it's just equal to $\left(\frac{d^2}{{dx}^2}\right)^2$? Calculate the second derivative first before squaring it? – mopy Nov 23 '15 at 14:25
• Check the reply of @dylan to your original post. – A Simmons Nov 23 '15 at 14:27
• There is a difference between the second derivative of the second derivative of a function (the fourth derivative if it exists), and the square of the second derivative of a function (typically not the fourth derivative) – Henry Nov 24 '15 at 0:15

No. If $f(x) = x^4$ then $\frac{d^4f}{dx^4} = 24$ whereas $\left(\frac{d^2f}{dx^2}\right)^2 = (12x^2)^2 = 144x^4$.

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}