Notation of the second derivative - Where does the d go? 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.
 A: ${\rm d}(A)$ means an infinitesimally small change in $A$. The ${\rm d}$ is an operator and you better look at it as a function and not a value.
If anything we drop the parenthesis from ${\rm d}x$ for brevity as it should be ${\rm d}(x)$ as in $$\frac{{\rm d}(y)}{{\rm d}(x)}$$ and
$$\frac{{\rm d}(\frac{{\rm d}(y)}{{\rm d}(x)})}{{\rm d}(x)} = \frac{ \frac{1}{{\rm d}(x)} {\rm d}({\rm d}(y))}{{\rm d}(x)} = \frac{{\rm d}({\rm d}(y))}{({\rm d}(x))^2} = \frac{{\rm d}^2(y)}{({\rm d}x)^2} = \frac{{\rm d}^2 y}{{\rm d}x^2}$$
A: 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.
A: 
where does the $d$ go?

Physicist checking in. All the other answers seem to focus on whether $d$ is a variable and are neglecting the heart of your question. 
Simply put, $dx$ is the name of one thing, so in your example
$$\frac{d^2u}{dx^2}=\frac{d^2u}{\left(dx\right)^2}$$
In your words, the "second $d$" is inside the implied parentheses. 
A: Gottfried Wilhelm Leibniz, who introduced this notation in the 17th century, intended $dx$ to be an infinitely small change in $x$ and $du$ to be the corresponding infinitely small change in $u$, so that if, for example, $du/dx=3$ at a particular point that means $u$ is changing $3$ times as fast as $x$ is changing at that point.
The notation $\dfrac{d^2u}{dx^2}$ actually means $\dfrac{d\left(\dfrac{du}{dx}\right)}{dx}$, the infinitely small change in $du/dx$ divided by the corresponding infinitely small change in $x$.  Thus the second derivative is the rate of change of the rate of change.
Notice that if $u$ is in meters and $x$ in seconds, then $du/dx$ is in $\dfrac{\text{m}}{\text{sec}}$, i.e. meters per second, and $d^2 u/dx^2$ is in $\dfrac{\text{m}}{\text{sec}^2}$, i.e. meters per second per second.  Thus $dx^2$ means $(dx)^2$, so the units of measurement of $x$ get squared, and $d^2y$ is in the same units of measurement that $y$ is in, consistently with the fact that $y$ is not a part of what gets squared in the numerator.
A: $d$ is not a variable, and neither is $dx$ for that matter.
It is confusing because in some case, like the chain rule, differentials act like variables which can cancel:
$$\frac{dy}{dx}\frac{dx}{dt}=\frac{dy}{dt}$$
However, it is most appropriate to think of $\frac{d}{dx}$ as an operator that does something.
Thus, $\frac{d}{dx}(\frac{d}{dx} y)=\frac{d^2}{dx^2}y$.
Somewhat similarly, you wouldn't say that $\sin^2 x=s^2i^2n^2x$
Edit: In case it isn't from the example, you cannot separate $dx$. That is, $dx$ is not $d$ times $x$. This is very much analogous to chemistry when we say things like $\Delta H$. This isn't $\Delta$ times $H$. It is $\Delta$ (change) of $H$.
