0

Assume $x$ is any real number and $z > 0$. I have the following function

$f_1 = tan^{-1} \left( \dfrac{b-x}{z} \right) - tan^{-1} \left( \dfrac{a-x}{z} \right)$

which I combine using the trigonometric identity

$tan^{-1} q - tan^{-1} r = tan^{-1} \left( \dfrac{q-r}{1+qr} \right)$

giving

$f_2 = tan^{-1} \left( \dfrac{z(b-a)}{(a-x)(b-x)+z^2} \right)$

However, plotting each of these functions shows that the two functions do not yield the same result. Assigning some dummy numbers, say $a = 0$, $b = 10$, and $z=10$.

plot

The issue appears to be when $x$ is equal to either $a$ or $b$. Why is the trig identity not working in this case?

grfrazee
  • 103
  • 3

1 Answers1

2

The identity $$\tan^{-1} q - \tan^{-1} r = \tan^{-1}\left(\frac{q - r}{1 + qr}\right)$$ has some limitations, due to $\tan^{-1}$ not being a proper inverse to $\tan$. In particular, the range of $\tan^{-1}$ is $\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$, and $\tan^{-1} q - \tan^{-1} r$ can easily be outside this range, e.g. if $\tan^{-1} q = \frac{\pi}{3}$ and $\tan^{-1} r = -\frac{\pi}{3}$. A more generally correct identity would be $$\tan(\tan^{-1} q - \tan^{-1} r) = \frac{q - r}{1 + qr}.$$ This implies the identity you wrote precisely when $$\tan^{-1} q - \tan^{-1} r \in \left(-\frac{\pi}{2}, \frac{\pi}{2}\right).$$ When $\tan^{-1} q - \tan^{-1} r > \frac{\pi}{2}$, we instead get: $$\tan^{-1} q - \tan^{-1} r - \pi = \tan^{-1}\left(\frac{q - r}{1 + qr}\right),$$ or similarly, we add $\pi$ if $\tan^{-1} q - \tan^{-1} r < -\frac{\pi}{2}$.

Theo Bendit
  • 50,900
  • Thanks, I thought it might have something to do with the range of the function. Been away from my math classes for too long! – grfrazee Apr 13 '22 at 22:56