Order of operations when using evaluation bar Suppose we have the function
\begin{align*}
f(x) = \sin(x)
\end{align*}
with first derivative
\begin{align*}
\frac{d}{dx}f(x) = \cos(x).
\end{align*}
If we evaluate $f'(x)$ at $x=0$, the result depends on whether you evaluate $f(0)$ or differentiate $f(x)$ first.
\begin{align*}
\displaystyle \frac{d}{dx}f(x)\mid_{x = 0} = \cos(x)\mid_{x = 0} = 1\\
\displaystyle \frac{d}{dx}f(x)\mid_{x = 0} = \frac{d}{dx}f(0) = \frac{d}{dx}0 = 0
\end{align*}
First question: Does this mean the following two statements are not equivalent?
\begin{align*}
\displaystyle \left(\frac{d}{dx}f(x)\right)\mid_{x = 0}\\
\displaystyle \frac{d}{dx}\left(f(x)\mid_{x = 0}\right)
\end{align*}
Second question: if so, which of the following is true, and why?
\begin{align*}
\displaystyle \frac{d}{dx}f(x)\mid_{x = 0} =
\left(\frac{d}{dx}f(x)\right)\mid_{x = 0}
\end{align*}
or
\begin{align*}
\displaystyle \frac{d}{dx}f(x)\mid_{x = 0} = \frac{d}{dx}\left(f(x)\mid_{x = 0}\right)
\end{align*}

If the following were true:
$$\frac{d}{dx}f(x)\mid_{x = n} = \frac{d}{dx}\left(f(x)\mid_{x = n}\right)$$
Then it would always be 0. Why? Because once you evaluate a function of x at a particular value of x, it is no longer a function of x; it's a value (or, a constant function). The example (sin, cos) you gave is a little misleading. Consider instead the function $f(x)=x^2$ , and instead the point $x=3$ :
$$\frac{d}{dx}f(x)\mid_{x = 0} = \frac{d}{dx}\left(f(x)\mid_{x = 0}\right)\\
f(x)\mid_{x = 0}=9\\
\frac{d}{dx}9=0$$
