5

Let $f(x) := \arctan(x) + \arctan(1/x)$. Then \begin{align*} f'(x) &= \frac{1}{x^2+1} + \frac{1}{(\frac{1}{x})^2 + 1}\cdot \frac{-1}{x^2} \\ &= \frac{1}{x^2 + 1} + \frac{-1}{x^2 + 1} \\ &= 0 \end{align*}

which should mean that $f$ is a constant function. However, this is false. If $x>0$, $f(x) = \pi/2$, and if $x<0$, $f(x) = -\pi/2$. This apparent contradiction probably has to do with the fact that $f$ is not defined at $x=0$. But where exactly does the reasoning break down?

I saw this in this question (comment thread a while down, searching arctan should find it).

aras
  • 5,649
  • 3
    You're right that the (mis)behavior of $f$ at $0$ is the issue: $f'(x) = 0$ implies that $f$ is constant on each component of its domain. The domain of this $f$ has two components, $(-\infty, 0)$ and $(0, \infty)$, and it is indeed constant on each. – Travis Willse Dec 12 '15 at 09:30
  • 3
    The property that your function has is known as locally constant. Every point $x$ where $f$ is defined has an open neighbourhood where the function is indeed constant. When the domain is disconnected like yours is (the domain is $\Bbb R-{0}$), then there are functions that are locally constant, but not (globally) constant, like this one. – Arthur Dec 12 '15 at 09:32

3 Answers3

7

It is not true that $f'(x)=0$ implies $f$ is constant for functions $f$ with an arbitrary domain. This implication is only valid when the domain is an interval. Since the domain of your function is $(-\infty,0)\cup(0,\infty)$, you can conclude that $f$ is constant on each of those intervals, but not necessarily that it is constant on their union (i.e., that it takes the same constant value on each of them).

Indeed, more generally, given any constants $c$ and $d$, you could define a function $g(x)$ on $(-\infty,0)\cup(0,\infty)$ by $g(x)=c$ if $x<0$ and $g(x)=d$ if $x>0$. Then $g'(x)=0$ for all $x$ in the domain of $g$, but $g$ is not constant (unless $c=d$).

Eric Wofsey
  • 330,363
2

The function can be rewritten as $$f(x) = \begin{cases} \pi/2 & \text{ if }x > 0\\ -\pi/2 & \text{ if }x < 0\end{cases}$$ The derivative is defined only for $x \neq 0$. At $x=0$, the function is not even continuous, since $\lim_{x \to 0^+}f(x) = \pi/2$ and $\lim_{x \to 0^-} f(x) = -\pi/2$. Hence, in fact, we have that $$f'(x) = 0 \text{ only when }x \neq 0$$

Adhvaitha
  • 20,259
0

Ніnt:

$$ \arctan(x) + \arctan(1/x)={\rm sign}(x) \frac{\pi}{2}, x \neq 0.$$

Leox
  • 8,120