Does the derivative with respect to something have to be a variable? When you take the derivative of an expression with respect to x, does x have to be a variable, or is it allowed to be a polynomial, a term, a vector, or anything else? It doesn't seem to make sense to me if x is not a variable.
 A: Intuitively, the derivative of $f$ with respect to $u$ is the limit of the change in $f$ as $u$ changes, divided by the change in $u$, as the change in $u$ vanishes. This does not require $u$ to be a "variable" in the usual sense: you can certainly ask for the rate of change of, say, $f(x) = \sin(x^2+1)$ with respect to $u=x^2$. So, no, it does not have to be an "independent variable" in the sense that you seem to be thinking about.
In fact, that's what the Chain Rule is all about! It tells you that if $f$ depends on $g$ and $g$ depends on $x$, then the rate of change of $f$ with respect to $x$ is equal to the rate of change of $f$ with respect to $g$, times the rate of change of $g$ with respect to $x$:
$$\frac{df}{dx} = \frac{df}{dg}\;\frac{dg}{dx}.$$
Here, we usually have $g$ a function, not a "variable". Yet we can talk about the derivative of $f$ with respect to $g$. 
Every time you have a function, you can try to talk about the rate of change of the function with respect to something else, provided you have some way of quantifying the change.
A: You could look at matrix calculus for example.
