This occurred to me a few days ago.
We know that the derivative of a function $y=f(x)$ is $\frac{dy}{dx}$. This is because it represents how $y$ changes with $x$, which is the rate of change of $y$, or more specifically, the gradient of a function.
Then the second derivative is the rate of change of rate of change, or the rate of change of gradient. Since a general rate of change is $\frac{d}{dx}$, the second derivative is $(\frac{d}{dx})(\frac{dy}{dx})$. Thus, the expanded form is $\frac{d^2y}{dx^2}$.
My question is, is the denominator $d(x)^2$ or is it $(dx)^2$? Surely, it would be the latter, because when you expand $(\frac{d}{dx})(\frac{dy}{dx})$, the $(dx)(dx)$ would become $(dx)^2$. But then why is it never written with brackets? I'm sure that would confuse some people and I only realised it myself when I started thinking about the second derivative properly, in terms of what it actually means.