Prime notation for derivatives This may seem like an overly trivial question, but I've just recently become confused about Langrange's 'prime' notation for derivatives (for example $f'(x)$).

I know for sure that $f&#39;(x) = \frac{\delta f(x)}{\delta x}$.

But suppose we replace x with an expression, like 2x+1. Do we write $f&#39;(x^2+1) = \frac{\delta f(x^2+1)}{\delta x}$ or $f&#39;(x^2+1) = \frac{\delta f(x^2+1)}{\delta (x^2+1)}$?

Does putting the prime around the function instead of between its letter and parentheses make a difference? For example what does $(f(x^2+1))&#39;$ mean?
$f&#39;$ is a function, so $f&#39;(2x + 1)$ denotes $f&#39;$ applied to $2x + 1$, or $\frac{df}{dx}(2x + 1)$.  For example if $f = x^2$ then $f&#39; = 2x$ and $f&#39;(2x + 1) = 4x + 2$.

$(f(x^2 + 1))&#39;$ is the derivative of the function $f(x^2 + 1)$, which is $2x f&#39;(x^2 + 1)$ by the chain rule.

This question highlights a weakness of the $&#39;$ notation, which is that it always comes with an implied variable with respect to which you're differentiating.  If this variable is clear from context there's no problem, but sometimes it isn't.
I am reading Quiaochu Yan when answering Cam:

1) $′$ is a function, so $′(2+1)$ denotes $′$ applied to $2+1$, or $\frac{\partial }{\partial }(2+1)$. For example if $=^2$ then $′=2$ and $′(2+1)=4+2$

2) $((^2+1))′$ is the derivative of the function $(^2+1)$, which is $2′(^2+1)$ by the chain rule

and I agree with Quiaochu but I don't understand why such difference is a weakeness of the $′$ notation. We see that $′(2+1)$ and $((^2+1))′$ are written differently, and they mean different things. There is no ambiguity, I think.
I am more puzzled about Hendrik Vogt's post, when he says that $(^2)′=2$ is ambiguous, where is the ambiguity?
On lessons, under the constrains of time, I use that notation constantly on introductory Calculus courses, wherever and whenever there is only one variable with respect to which we are differentiating with. I noticed that such notation is more common in European countries than in the UK and rare in the United States, to the extent that some colleagues told me that it was wrong to write $((^2+1))′$.