How does a single $d$ in Leibniz notation work? Eg, $y\,\mathrm{d}x-x\,\mathrm{d}y\equiv-x^2\,\mathrm{d}\left(\frac{y}{x}\right)$ Recently a lecturer used this notation, which I assume is a sort of twisted form of Leibniz notation:
$$y\,\mathrm{d}x - x\,\mathrm{d}y \equiv -x^2\,\mathrm{d}\left(\frac{y}{x}\right)$$
The logic here was that this could be used as:
$$\begin{align}
-x^2\,\mathrm{d}\left(\frac{y}{x}\right) &\equiv -x^2\,\left(\frac{\mathrm{d}y}{x} -\frac{y}{x^2}\,\mathrm{d}x\right)\\
&\equiv y\mathrm{d}x - x\mathrm{d}y
\end{align}
$$
Why is this legal?
I can see some kind of differentiation going on with the second term in the above equivalence, producing the $\frac{1}{x^2}$, but having the single $\mathrm{d}$ seems like a really weird abuse of notation, and I don't quite follow why it splits the single $\frac{y}{x}$ fraction into two parts.
 A: You should know that the differential at a point $\mathbf x_0$ of a function $\;\mathbf R^m\longrightarrow \mathbf R^n$ is the linear map $\:\ell:\mathbf R^m\longrightarrow \mathbf R^n$, that yields the best linear approximation of $f(\mathbf x_0)$ in a neighbourhood of $\mathbf x_0$, in the sense that we have
$$f(\mathbf x_0+\mathbf h)=f(\mathbf x_0)+\ell(\mathbf h)+o\bigl(\|\mathbf h\|\bigr).$$
This differential is denoted $\:\mathrm d f_{\mathbf x_0}$ (or simply $\mathrm df$ for the differential at a generic point). A linear function is of course its own differential.
With the usual  abuse of language that denotes a function $f$ by its value at a given point, we obtain that the differential of the $i$-th projection $\:p_i:\mathbf x=(x_1,x_2,\dots,x_m)\longmapsto x_i$ is denoted $\mathrm dx_i$.
As an example, in the case of a function of a single variable $x$, the linear map defining the differential simply corresponds to the equation of the tangent to the graph of $f$ with abscissa $x_0$:
$$f(x_0+h)=f(x_0)+f'(x_0)h,\enspace\text{i.e. }\quad \mathrm df_{x_0}:h\longmapsto f'(x_0)h,$$
that we may write as $\enspace\mathrm df=f'(x)\,\mathrm dx$. This notation is generalised to functions of $m$ variables under the form
$$\mathrm df=\frac{\partial f}{\partial x_1}\,\mathrm dx_1+\frac{\partial f}{\partial x_2}\,\mathrm dx_2+\dots+\frac{\partial f}{\partial x_m}\,\mathrm dx_m. $$
The usual formulæ for the derivatives have a ‘differential version’:

*

*$\mathrm d(f+g)=\mathrm df+\mathrm dg$,

*$\mathrm d(fg)=f\,\mathrm dg+g\,\mathrm df$,

*$\mathrm d\Bigl(\dfrac fg\Bigr)=\dfrac1{g^2}\bigl(g\,\mathrm df-f\,\mathrm dg\big),$

*$\mathrm d(g\circ f)=\mathrm dg_{f(x)}\circ\mathrm df_x$.

A: Such arguments can always be rephrased to avoid treating $dx$ and $dy$, etc, as individual "infinitesimal" quantities. (On the other hand, "infinitesimal intuition" is a powerful and intuitive way to derive calculus formulas, so I can see why physicists are drawn to it.)
I'll assume that $y$ is a function of $x$. Let $h(x) = y(x)/x$. Then
$$
h'(x) = \frac{x y'(x) - y(x)}{x^2}
$$
so
$$
\tag{1} -x^2 h'(x) = y(x) - x y'(x).
$$
That's probably how I would write it, because the meaning is perfectly clear.
We could also write (1) using Leibniz notation:
$$
-x^2 \frac{dh}{dx} = y - x \frac{dy}{dx}.
$$
If we then "multiply through by $dx$", we obtain
$$
- x^2 dh = y dx - x dy
$$
which is what your lecturer wrote.
I can imagine that some people think the version using infinitesimal notation is more beautiful or more intuitive.
A: In the context for this discussion you have two variables $x$ and $y$ that are somehow related. Perhaps you have $y$ as a function of $x$, or perhaps both depend on some other parameter $t$. You are interesting in knowing how small changes in $x$ and $y$ change the    quotient $y/x$, written as the product
$y \times (1/x)$. So what you are looking for is $d(y/x)$. If $y$ depends explicitly on $x$ you can think of this as calculating $d/dx$. If the dependence is just implicit it's easier to work with the differentials.
The actual algebra uses  the product rule and the  rule for differentiating $1/x$. You could do it directly with the quotient rule.
To see more intuitively what is going on, simplify the expression
$$
-x^2\left( \frac{y+dy}{x+dx} -  \frac{y}{x} \right)
$$
and remember that $dx$ and $dy$ are small.
A: I believe it is being used as shorthand for:
$$d\left(\frac yx\right)=dx\frac{d\left(\frac yx\right)}{dx}=dx\left(\frac{dy}{dx}x-\frac{y}{x^2}\right)=xdy-\frac{y}{x^2}dx$$
A: Very often it works to just think of $\mathrm{d}f$ as an alternative notation to $f'$ or the derivative of $f$ with respect to some unnamed variable.
For example, assume that $x$ and $y$ are functions of some common variable. Then we have
$$
y\,x' - x\,y' = -x^2 (y/x)'
$$
Just using the notation $\mathrm{d}f$ instead of $f'$ gives
$$
y\,\mathrm{d}x - x\,\mathrm{d}y = -x^2 \mathrm{d}(y/x).
$$
