TITLE: Notation of the second derivative - Where does the d go?
QUESTION [38 upvotes]: In school I was taught that we use $\frac{du}{dx}$ as a notation for the first derivative of a function $u(x)$. I was also told that we could use the $d$ just like any variable.
After some time we were given the notation for the second derivative and it was explained as follows:
$$
\frac{d(\frac{du}{dx})}{dx} = \frac{d^2 u}{dx^2}
$$
What I do not get here is, if we can use the $d$ as any variable, I would get the following result:
$$
\frac{d(\frac{du}{dx})}{dx} =\frac{ddu}{dx\,dx} = \frac{d^2 u}{d^2 x^2}
$$
Apparently it is not the same as the notation we were given. A $d$ is missing.
I have done some research on this and found some vague comments about "There are reasons for that, but you do not need to know..." or "That is mainly a  notation issue, but you do not need to know further."
So what I am asking for is: Is this really just a notation thing?
If so, does this mean we can actually NOT use d like a variable?
If not, where does the $d$ go?
I found this related question, but it does not really answer my specific question. So I would not see it as a duplicate, but correct me if my search has not been sufficient and there indeed is a similar question out there already.

REPLY [5 votes]: Think of the meaning of $d/dx$. The $d$ in the numerator is an operator: it says, "take the infinitesimal difference of whatever follows $d/dx$". In contrast, the $dx$ in the denominator is just a number (yes, I know; mathematicians, please don't cringe): it is the infinitesimal difference in $x$.
So $d/dx$ means "take the infinitesimal difference of whatever follows, and then divide by the number $dx$."
Similarly, $d^2/dx^2$ means "take the infinitesimal difference of the infinitesimal difference of whatever follows, and then divide by the square of the number $dx$."
In short, the $d$ in the numerator is an operator, whereas in the denominator, it is part of a symbol. A slightly less ambiguous notation, as suggested by user1717828, would be to put the $(dx)$ in the denominator in parenthesis, but it really isn't necessary in practice.