# Derivative at a point

When you write the differential at a point, you write f(x)|_(x = k). What is the correct LaTeX command for the "|" symbol? Is it just a pipe, or is there a separate mathematical symbol for it?

My LaTeX for the above is:

$f^\prime(x)|_{x = 1} = 5$


Is this formally correct?

-
Why not simply f'(1)=5? –  egreg Jul 21 '12 at 10:14

This is not a differential, but a derivative; they are different things. Since f' denotes the derivative of f, which is a function of its own, the best notation for the value at 1 is

f'(1)

If you want to use the heavier notation

f'(x)|x=1

then

$f'(x)|_{x=1}$


is perfectly good. You may want to define a command for this:

\newcommand{\at}[2][]{#1|_{#2}}


to be used as

$f'(x)\at{x=1}$


or, if you need a larger bar to cover a larger function symbol,

$f'(x)\at[\big]{x=1}$


The optional argument can be one of \big, \Big, \bigg or \Bigg. I wouldn't use an automatically growing bar, because it may give bad results.

-
Shouldn't it read \newcommand*{\at}[2][]{#1|_{#2}} ? –  cgnieder Jul 21 '12 at 10:41
@cgnieder Of course! –  egreg Jul 21 '12 at 10:46
It has to be noted that you can understand the Jacobian as a differential and denote it by f' as well. Although you are right that in the real one-dimensional case one usually does not use the word differential. –  canaaerus Jul 21 '12 at 10:48
@canaaerus And why not using $f'(P)$ (P denoting the point where the Jacobian or Fréchet derivative is computed) as well? Of course it depends on local traditions what notation to use. –  egreg Jul 21 '12 at 10:56
@asymptotically Writing f' and f^\prime in math mode is equivalent and the former is much better both for typing and for reading the source. The second derivative can be written f'' instead of f^{\prime\prime} and here it's easy to see which one is better. –  egreg Jul 21 '12 at 11:08

Basically just using | is mostly ok, but I have defined a special purpose command for this, that automatically scales the line vertically:

\newcommand\at[2]{\left.#1\right|_{#2}}


So you can write \at{f'}{x=1}. Alternatively there is also a \vert command, which is probably a bit more semantic, but is actually just a synonym for |.

Of course this makes sense mostly for bigger expressions like

\at{\frac{df}{dt}}{t=1}


Concerning the spacing see egregs comment, although I didn't notice this before.

-
I tried both, and they produced the same output as "|", except that the \at command had an extra pixel to the left. And the \rvert command was undefined, but \vert produced the same as "|". Is the "|" semantically correct or should I use something different? –  asymptotically Jul 21 '12 at 10:19
You're introducing unwanted spacings at the left (1.2pt, which is quite noticeable): probably {\left.\kern-\nulldelimiterspace#1\right|_{#2}} (with an additional pair of braces) is better. Also \right| and \right\rvert are equivalent; I wouldn't use \rvert in the \left-\right free version, but | which is an ordinary symbol, while \rvert` is a "closing atom". –  egreg Jul 21 '12 at 10:20