Algebra with derivatives operators Suppose that $y=ax$. This is an often used "calculation", especially in physics:
$$
\frac{d^2}{dx^2}=\frac{d}{dx}\frac{d}{dx}=\left(\frac{dy}{dx}\frac{d}{dy}  \right)\left(\frac{dy}{dx}\frac{d}{dy}  \right)= \left(a\frac{d}{dy} a\frac{d}{dy}  \right)=a^2 \frac{d^2}{dy^2}
$$
But $\frac{d}{dx}$ is only a symbol, not a fraction. So, how we can justify this result and in what conditions is it true ?
 A: Consider a function $f:U\to\mathbb{R}$ for some open subset $U\subseteq\mathbb{R}$. If $f$ is differentiable, we denote its derivative simply as $\frac{df}{dx}$. Now, suppose we had some auxiliary function $y(x)=ax$. If we compose $f$ with $y$, we get a new differentiable function $g:V\to\mathbb{R}$ (where $V$ depends on $U$ and $a$) where $g=f\circ y$. In particular, we write
$$g(x)=f(y(x))$$
To take the derivative of this function, we use the chain rule and get
$$g'(x)=f'(y(x))y'(x)$$
If we think of $f$ as taking some independent argument $y$, the term $f'(y(x))$ is instead lazily written as $\frac{df}{dy}$. Then we have
$$\frac{dg}{dx}=\frac{df}{dy}\frac{dy}{dx}=a\frac{df}{dy}$$
If we further apply a second derivative just to drive the point home, we get
$$\frac{d^2g}{dx^2}=a^2\frac{d^2f}{dy^2}\implies\frac{d^2}{dx^2}(f\circ y)=a^2\frac{d^2}{dy^2}(f)$$
The connection between these symbols as we have presented implies that they cannot be exactly the same, right? Each operation is performed on a different function, either $f$ or $f\circ y$. Can these be used interchangeably?
Basically, these operators are not identical, which is clear based on the fact that they operate on different functions with different domains. In some abstract sense, however, in physics (where the domains are usually all of $\mathbb{R}^n$ or some convenient subset) the transformation of $y$ is often a valid way of changing a view of the space. For example, transformations like these often appear when nondimensionalizing equations, which sort of just stretch or squash the domain in question. This equation basically says "if we change the way we look at the domain, then we can view $f$ either as a function of its original variable or as a function of some new variable I have prescribed."
Here's a silly example. Suppose I have a function $f:\mathbb{R}\to\mathbb{R}$ with $f(y)=y^2$. We then define a function $y(x)=2x$, so $f(y(x))=4x^2$. If I write the symbol $\frac{df}{dx}$, I might be implying that I actually want the derivative of $f\circ y$, since I used the symbol $x$ in the composition, so maybe it's correct to say $\frac{df}{dx}=8x$ in a certain context. However, if I asked you what $\frac{df}{dy}$ is, it should be clear that $\frac{df}{dy}=2y$, but the "symbols" of $\frac{df}{dx}$ and $\frac{df}{dx}$ only mean "the derivative of $f$", so why would they be different? They're different because $\frac{df}{dx}=8x$ is an abuse of notation and conceptualization. It's actually a garbage statement, but it gets the point across as to what I am looking for.
Hopefully this helps! This is sort of an annoying foray into how physicists abuse math however they want, but it often works, so they keep doing it...
