"Real Contour Integration" It is possible to find the number of complex roots of a function $f(z)$ in a contour $\gamma$ using complex contour integration. I was wondering if you can do the same thing on the real line: take a real-valued function $f(x)$ and find the number of real roots in a contour (usually a circle with a center $(a,b)$ and radius $r$) using "real contour integration" (I don't know if it exists or does it have another name)?  
 A: You can use the Argument Principle to find the number of roots of a function in an interval (technically, the number of roots minus the number of poles). It works like this. Suppose you have a function $f(x)$ on an interval $(a,b).$ Then you switch to a complex variable $f(z),$ and you parametrize a circle $C$ centered at $c=(a+b)/2,$ with radius $r=(b-1)/2.$ It's centered at the center of the interval, and its radius is half the width of the interval. You could do other contours, but this is perhaps the simplest. The Argument Principle, then, says that the integral
$$\frac{1}{2\pi i}\oint_C\frac{f'(z)}{f(z)}\,dz=Z-P, $$
where $Z$ is the number of zeros inside $C,$ and $P$ the number of poles inside $C.$ To carry this a bit further, the parametrization would look like this:
$$z=c+re^{i\theta},\; 0\le \theta\le 2\pi. $$
Then $dz=ie^{i\theta}\,d\theta,$ and you would write
$$\frac{1}{2\pi i}\int_0^{2\pi}\frac{f'\big(c+re^{i\theta}\big)}{f\big(c+re^{i\theta}\big)}\,ie^{i\theta}\,d\theta=Z-P. $$
Important note: if you're concerned about picking up zeros and poles not on the real line, then you can choose a rectangular contour as follows:
\begin{array}{|c|c|c|c|} \hline
 &z &t\;\text{interval} &dz\\ \hline
\gamma_1 &a+i\varepsilon(1-2t) &[0,1] &-2i\varepsilon\,dt \\ \hline
\gamma_2 &a+t(b-a)-i\varepsilon &[0,1] &(b-a)\,dt \\ \hline
\gamma_3 &b+i\varepsilon(-1+2t) &[0,1] &2i\varepsilon\,dt \\ \hline
\gamma_4 &b+t(a-b)+i\varepsilon &[0,1] &(a-b)\,dt \\ \hline
\end{array}
For many functions you can choose $\varepsilon>0$ small enough not to pick up any zeros or poles inside this rectangle, traversed counter-clockwise. The final contour $C$ would then be $C=\gamma_1\cup\gamma_2\cup\gamma_3\cup\gamma_4.$
So much for the Argument Principle.
An example of real contour integration is the work function calculation:
$$W=\int_C\mathbf{F}\cdot d\mathbf{r}. $$
This is the work done by the vector force $\mathbf{F}$ along $C.$ Notice that, at any point on $C,$ only the component of $\mathbf{F}$ parallel to the tangent differential $d\mathbf{r}$ contributes to the work done. 
