Why is saying $\frac{dy}{dx}\frac{dy}{dx}=y\frac{d^2y}{(dx)^2 }$ not valid? Does Leibniz notation (and thinking of it as an infinitesimal quotient) not work for higher-order derivatives?
Can Leibniz Notation Be Treated As a Quotient?
4 Answers
The $d$ sticks to its argument. It's not a multiplication. Just like the trigonometric function $\mathrm{sin}\, x$ is not a multiplication either.
So $dx \cdot dx = (dx)^2$. You cannot separate the $x$ and the $d$. So it's nonsense to write it as $xd^2x$. The applicable rules are defined by the differential algebra.
So in your example $\frac{dy}{dx}\cdot\frac{dy}{dx} = \frac{(dy)^2}{(dx)^2} = \left(\frac{dy}{dx}\right)^2$.
You can treat the Leibniz notation as a quotient as long as there is a constraint that ensures that all differentiated variables in your expression change if you change any one of them (partial derivatives are a different matter).
The $d$ may get an upper index if it's nested like: $d(d(dx)) = d^3x$.
Your intuition is correct that the derivative OPERATOR can be multiplied together in such a manner i.e. $\frac{d}{dx}\frac{d}{dx} = \frac{d^2}{dx^2}$. However, the expression $\frac{dy}{dx} = \frac{d}{dx}(y)$ is an evaluated derivative on the function $y$ we write the $y$ in the numerator with $d$ as a notational convenience. When you evaluate a derivative, it no longer behaves like the derivative operator and is now simply a function. Another way to look at it is if you consider $\frac{d}{dx}$ as a "function" then the product $\frac{d}{dx}\frac{d}{dx}$ is simply the composition of two derivative functions, conversely $\frac{dy}{dx} \frac{dy}{dx}$ is the product of two evaluated functions. So we can restructure your question of follows : does $f(x)*f(x) = f(f(x))$ ? the answer is obviously no. However, $(f\circ f)(x) = f(f(x))$ is true by the definition of composition of functions.
Consider $y=3x$ then $\frac{dy}{dx} =3$. So the left hand side of your equation would be 9. However, $\frac{d^{2}y}{dx^{2}} =0$, so the right hand side of your equation would be 0 for this example, but $0\neq 9$. Thus, the function $y=3x$ provides a counterexample.
Leibniz notation does work for higher derivatives, the nth derivative of y is denoted by $\frac{d^{n}y}{dx^{n}}$. However, treating the derivative as a quotient is called abuse of notation and is considered more as a convenient tool to help students remember certain rules like the chain rule. There is actually a way of treating infinitesimals rigorously is treated in what is known as non-standard analysis, but this isn't really the most common approach.
Since $$f''(a)=\lim_{h\to0}\frac{f(a+2h)-2f(a+h)+f(a)}{h^2}$$ under suitable conditions, I suppose one could conceptualize the $d^2 f$ in $d^2 f/dx^2$ as a "second-order" infinitesimal difference: i.e., as $f(x+2dx)-2f(x+dx)+f(x)$. Mind you, I've never liked thinking in terms of "infinitesimals" :-)