Heaviside Step Function In studying properties of 1/x, its derivatives and its integral,  I came across the following "apparent" identity. Plot it, and found that it appears to be the same as the Heaviside function.  Any post with reference to the RHS, or verifying/disproving would be appreciated.
$$\frac{\arctan(1/x)+\arctan(x+1/2)+\arctan(2(x^2+1)+x)}{\pi} = H(x)$$
Thanks in advance.  
 A: $$\frac{d}{dx}\arctan(X)=\frac{1}{X^2+1}\quad\to\quad \begin{cases}
\frac{d}{dx}\arctan(\frac{1}{x} )=\frac{1}{\frac{1}{x^2}+1}\left(-\frac{1}{x^2} \right) \\
\frac{d}{dx}\arctan(x+\frac{1}{2} )=\frac{1}{\left(x+\frac{1}{2} \right)^2+1} \\
\frac{d}{dx}\arctan(2x^2+x+2)=\frac{1}{(2x^2+x+2)^2+1}(4x+1)
\end{cases}$$
$$f(x)=\arctan(\frac{1}{x} )+\arctan(x+\frac{1}{2} )+\arctan(2x^2+x+2)$$
$f(x)$ is continuous except at  $x=0$
$$\begin{cases}
x\to 0^+ \quad f(x)\to \frac{\pi}{2}+\arctan(\frac{1}{2} )+\arctan(2)=\pi \\
x\to 0^- \quad f(x)\to -\frac{\pi}{2}+\arctan(\frac{1}{2} )+\arctan(2)=0 
\end{cases} \tag 1$$
$$\frac{d}{dx}f(x)=\frac{1}{\frac{1}{x^2}+1}\left(-\frac{1}{x^2} \right)+\frac{1}{\left(x+\frac{1}{2} \right)^2+1}+\frac{1}{(2x^2+x+2)^2+1}(4x+1)\qquad x\neq 0$$
Expanding and simplifying leads to 
$$\frac{d}{dx}f(x)=0\qquad x\neq 0$$
Hence 
$$f(x)=\text{constant}\qquad x\neq 0$$
Determination of the constant in each continuous range:
$$x>0\qquad x\to+\infty \qquad \begin{cases}
\arctan(\frac{1}{x} )\to 0 \\
\arctan(x+\frac{1}{2} )\to \frac{\pi}{2}\\
\arctan(2x^2+x+2)\to \frac{\pi}{2}
\end{cases}
\qquad f(x)\to \frac{\pi}{2}+\frac{\pi}{2}=\pi$$ 
$$x<0\qquad x\to-\infty \qquad \begin{cases}
\arctan(\frac{1}{x} )\to 0 \\
\arctan(x+\frac{1}{2} )\to -\frac{\pi}{2}\\
\arctan(2x^2+x+2)\to \frac{\pi}{2}
\end{cases}
\qquad f(x)\to -\frac{\pi}{2}+\frac{\pi}{2}=0$$
$$f(x)=\begin{cases}0\qquad x<0 \\ 1\qquad x>0 \end{cases} \quad\text{and with }(1)\quad\implies\quad f(x)=H(x)$$
$$\frac{f(x)}{\pi}=\frac{\arctan(1/x)+\arctan(x+1/2)+\arctan(2(x^2+1)+x)}{\pi} = H(x)$$
A: $$\tan\left(\arctan(x+\tfrac12)+\arctan(2(x^2+1)+x)\right)=\frac{x+\frac12+2(x^2+1)+x}{1-(x+\frac12)(2(x^2+1)+x)}=\frac{2x^2+2x+\frac 52}{-x(2x^2+2x+\frac 52)}=-\frac1x.$$
From this one can derive
$$\arctan(x+\tfrac12)+\arctan(2(x^2+1)+x)=k\pi-\arctan\frac1x.$$
The step is due to the $k\pi$ term which ensures that the LHS stays positive and continuous.

A: This is a more general answer.
Since $\quad \tan(a+b)=\frac{\tan(a)+\tan(b)}{1-\tan(a)\tan(b)} \quad$ with $\tan(a)=u(x)$ and $\tan(b)=v(x)$ one can write a lot of expressions such as :
$$f(x)=\arctan\left(u(x)\right) +\arctan\left(v(x)\right)-\arctan\left(\frac{u(x)+v(x)}{1-u(x)v(x)}\right)=k\pi$$
with $k$ integer.
$$f(x)=\arctan\left(u(x)\right) +\arctan\left(v(x)\right)+\arctan\left(\frac{u(x)+v(x)}{u(x)v(x)-1}\right)=k\pi$$
If $u(x)$ and/or $v(x)$ is infinite at some value(s) of $x$, the respective arctan( ) goes from $\pm\frac{\pi}{2}$ to $\mp\frac{\pi}{2}$ that is a step of amplitude$=\pi$ for $f(x)$ which can be expressed with the step function.
The example given by Escanellas corresponds to $u(x)=\frac{1}{x}$ and $v(x)=x+\frac{1}{2}$.
Many similar expressions with other functions can be generated that way.
$$\frac{\arctan\left(u(x)\right) +\arctan\left(v(x)\right)+\arctan\left(\frac{u(x)+v(x)}{u(x)v(x)-1}\right)}{\pi}=\text{sum of Heaviside functions}.$$
For example, with $u=\frac{1}{x^2}$ and $v=-x-1$ :
$$\frac{\arctan(\frac{1}{x^2})+\arctan(-x-1)+\arctan(\frac{x^4+x^3-1}{x^3+x+1})}{\pi} = H(x)-H(x+1)$$
