TITLE: Proof for a infinite series representation of $\tan(x)$?
QUESTION [5 upvotes]: I was messing around on Desmos (the online graphing calculator) the other day and accidentally created the following.
$\hskip{2.5in}$
This graph looks very similar to $\tan(x)$, which lead me to conjecture that
$$\tan(x)=\sum_{n=-\infty}^{\infty}\frac{-1}{x+\pi n + \frac{\pi}{2}}.$$
I went online searching for a proof and found nothing useful (mostly Taylor and Maclaurin series representations). Additionally, my personal attempts have been abysmal. Hence why I post this and request a proof. A reference to a proof would also be great, but I would still prefer it shown here.

REPLY [3 votes]: FYI,
$\sum\limits_{n=-\infty}^{\infty}\dfrac{-1}{x+\pi n + \frac{\pi}{2}}=\sum\limits_{n=1}^{\infty}\dfrac{-1}{x+\pi n + \frac{\pi}{2}}+\sum\limits_{n=1}^{\infty}\dfrac{-1}{x-\pi n + \frac{\pi}{2}}-\dfrac{1}{\frac{x}{\pi}+\frac{1}{2}}\tag1$
$\dfrac{1}{\pi}\Big[\sum\limits_{n=1}^{\infty}\dfrac{-1}{\frac{x}{\pi}+\frac{1}{2} +n }+\sum\limits_{n=1}^{\infty}\dfrac{1}{-(\frac{x}{\pi}+\frac{1}{2}) +n }-\dfrac{1}{\frac{x}{\pi}+\frac{1}{2}}\Big]=\tag2$
Using the following identity refer to Digamma function:
$\psi(z+1)=-\gamma +\sum\limits_{n=1}^\infty \Big(\frac{1}{n}-\frac{1}{n+z}\Big)$
$ \dfrac{1}{\pi}\Big[{\psi(1+\frac{x}{\pi}+\frac{1}{2})-\psi(1-\frac{x}{\pi}-\frac{1}{2})-\frac{1}{\frac{x}{\pi}+\frac{1}{2}}}\Big]\tag3$
Applying that $\psi(z+1)=\psi(z)+\frac{1}{z}$ and the reflexion formula of Digamma function $\psi(1-z)-\psi(z)=\pi\cot(\pi z)$ we get: 
$\dfrac{1}{\pi}\Big[\psi(\frac{x}{\pi}+\frac{1}{2})-\psi(1-\frac{x}{\pi}-\frac{1}{2})\Big]=-\cot(x+\frac{\pi}{2})=\tan(x)\tag4$