A problem on Rolle's theorem So there's this question that asks us to prove that, between any two roots of $\tan x=1$ there exists at least one root of $\tan x =-1$. Suppose we assume that $a,b$ are two roots of $\tan x-1=0$, then $f(a)=f(b)=0$, where $f(x)= \tan x-1$. According to the theorem, $f'(c)=0$ where $c \in (a,b)$,i.e., $\sec^2 c =0$....and this is not defined. Either there's something wrong with my understanding or with the problem. Please help.

Let $f(x)=\tan x -1$,  and $g(x)=\tan x +1$.
The roots of $f(x)$ occur in the interval $I=[\frac{\pi}{4}+\pi k, \frac{\pi}{2}+\pi k)\bigcup (\frac{\pi}{2}+\pi k, \frac{5\pi}{4}+\pi k]$ for some $k\in\mathbb{Z}$. The roots of $f(x)$ occur at the endpoints of interval $I$.
The roots of $g(x)$ occur in the interval $J=[-\frac{\pi}{4}+\pi k, \frac{\pi}{2}+\pi k)\bigcup(\frac{\pi}{2}+\pi k, \frac{3\pi}{4}+\pi k]$ for some $k\in\mathbb{Z}$. The roots of $g(x)$ occur at the endpoints of interval $J$.
The interval $(\frac{\pi}{2}+\pi k, \frac{3\pi}{4}+\pi k]$ is contained in $[\frac{\pi}{4}+\pi k, \frac{\pi}{2}+\pi k)\bigcup (\frac{\pi}{2}+\pi k, \frac{5\pi}{4}+\pi k]$ and a root of $g(x)$ occurs at $x=\frac{3\pi}{4}+\pi k$. Roots of $f(x)$ occur at $x=\frac{\pi}{4}+\pi k$ and $x=\frac{5\pi}{4}+\pi k$.
$\frac{\pi}{4}+\pi k<\frac{3\pi}{4}+\pi k<\frac{5\pi}{4}+\pi k $.
So there is at least one root of $g(x)$ between any two roots of $f(x)$.
