If $p>q>0$ and $pr<-1<qr$ then find the value of $\arctan \dfrac{p-q}{1+pq}+ \arctan\dfrac{q-r}{1+qr}+\arctan\dfrac{r-p}{1+rp}$
Attempt:
Formula used:
$$\arctan p - \arctan q = \arctan\frac{p-q}{1+pq} $$ if $pq>-1$
$\implies \arctan p - \arctan q + \arctan q - \arctan r + \arctan\dfrac{r-p}{1+rp}$
Now, as $p>0$ and $pr<-1$ $\implies r<0$
Formula to be used now:
$$\arctan x - \arctan y = \pi + \arctan \dfrac{x- y}{1+xy}$$ if $x>0 , y< 0 ,xy<-1$
$\implies \arctan p - \arctan r - \arctan \dfrac{p-r}{1+rp} $ $(as \arctan(-x)= -\arctan(x))$
$= \arctan p - \arctan r - (\pi +\arctan p - \arctan r)$
$= -\pi$
But answer given in the book is $\pi$.
Is my approach incorrect? I am quite confident about it.