So this gives a strange "step" plot, kind of like a signum plot. I came across a formula for the substraction of atans, however i would like to know whether there is a simpler way of achieving this plot.
-
https://math.stackexchange.com/questions/1837410/inverse-trigonometric-function-identity-doubt-tan-1x-tan-1y-pi-tan – lab bhattacharjee Jan 13 '19 at 17:27
3 Answers
Note that $$\arctan(x)-\arctan(y)=\arctan(\frac{x-y}{1+xy})$$ if $$xy>-1$$ or $$\pi+\arctan(\frac{x-y}{1+xy})$$ for $$x>0$$ and $$xy<-1$$ or$$\pi-\arctan(\frac{x-y}{1+xy})$$ for $$x<0$$ and $$xy<-1$$

- 95,283
go to https://develop.open.wolframcloud.com/app/ -> "create a new notebook" -> write:
Plot[ArcTan[(x-1)/(x+1)]-ArcTan[x],{x,a,b}].
where $ a,b $ are the upper and lower bounds of the plot.
the plot will be: $$ \left\{ \begin{array}{c}y=\frac{3}{4}\pi \ \ for \ \ x<-1 \\ y= -\frac{\pi}{4} \ \ for \ \ x>-1 \end{array} \right. $$

- 1,579
You might want to see the equivalent expression of the expression $\arctan(x)+\arctan(y)$. You can arrive at this expression using the known formula for $\tan(A+B)$. In case you're unfamiliar with it, you might wanna recall $\sin(A+B)$ and $\cos(A+B)$ ( Click Here to read beep-boops' answer to Help me prove: sin(A+B) = sinA cosB + cosA sinB ) and the definition of $\tan(\varphi)$ as $\dfrac{\sin(\varphi)}{\cos(\varphi)}$.
First of all let us simplify and clean up things a bit. Let us make the following substitutions:
$$\begin{pmatrix} \arctan(x) \\ \arctan(y)\end{pmatrix}=\begin{pmatrix} \alpha \\ \beta \end{pmatrix} \tag1$$
Now, $$\tan(\alpha \pm \beta)=\dfrac{\tan(\alpha)\pm\tan(\beta)}{1\mp\tan(\alpha)\tan(\beta)} \tag2$$ Replace $\alpha$ and $\beta$ with their equivalents in equation $(2)$ as in $(1)$ and taking the arctangent on both sides of equation $(2)$ to obtain: $$\arctan(x)\pm\arctan(y)=\arctan \Biggl(\dfrac{x\pm y}{1\mp xy}\Biggr) +n\pi\tag3$$
With the function the OP has stated. We get $f(x)=\arctan \Biggl(\dfrac{\frac{x-1}{x+1}-x}{1+x\frac{x-1}{x+1}} \Biggr)$ which simplifies to $f(x)=-\arctan(1)$ and gives you the plot defined in a piecewise fashion as: $$f(x)=\begin{cases} \frac{3\pi}{4} & x \le -1 \\ -\frac{\pi}{4} & x \ge -1 \\ \end{cases} $$

- 6,481
-
You might want to add $n\pi$ on the right-hand side of equation $(3)$, especially since it turns out $f(x)$ is $-\arctan(1) + \pi$ rather than $-\arctan(1)$ on part of its domain. – David K Jan 13 '19 at 18:23