TITLE: Proof of Leibniz $\pi$ formula
QUESTION [6 upvotes]: I found the following proof online for Leibniz's formula for $\pi$:
$$\frac{1}{1-y}=1+y+y^2+y^3+\ldots$$
Substitute $y=-x^2$:
$$\frac{1}{1+x^2}=1-x^2+x^4-x^6+\ldots$$
Integrate both sides: 
$$\arctan(x)=x-\frac{x^3}{3}+\frac{x^5}{5}-\frac{x^7}{7}+\ldots$$
Now plug in $1$ for $x$: 
$$\frac{\pi}{4}=1-\frac{1}{3}+\frac{1}{5}-\frac{1}{7}+\ldots$$
The thing I am confused about is that the Taylor expansion for $\frac{1}{1-y}$ only works for $-1<y<1$. Why is this still a legitimate proof? At the end, we compute the integral of both sides to $y=-1$.

REPLY [2 votes]: Start with
\begin{equation}
\int \limits_0^x \frac{dt}{1+t^{2}}=x-\frac{x^{3}}{3}+\frac{x^{5}}{5}-\frac{x^{7}}{7}+\ldots\qquad + \frac{x^{4n+1}}{4n+1}-R_{n}(x), \quad x \in \mathbb{R}: 0\leq x \leq 1
\end{equation}
Where
\begin{equation}
R_{n}(x) = \int \limits_0^x\frac{t^{4n+2}}{1+t^{2}}dt
\end{equation}
NOo, since the square of a real number is certainly  non-negative then $1 \leq 1+t^{2}$ hence
\begin{equation}
0 \leq R_{n}(x) \leq \int \limits_0^x  t^{4n+2}dt
\end{equation}
Or, alternatively
\begin{equation}
0 \leq R_{n}(x) \leq \frac{x^{4n+3}}{4n+3}
\end{equation}
As, a the outset we said $0 \leq x \leq 1$ we find
$$\frac{x^{4n+3}}{4n+3} \leq \frac{1}{4n+3}$$ thus
$$0 \leq R_{n}(x) \leq \frac{1}{4n+3}$$
It should be clear that $$\frac{1}{4n+3} \rightarrow 0, n \rightarrow 0$$
Which clearly implies that
\begin{equation}
\int \limits_0^x \frac{dt}{1+t^{2}}=x-\frac{x^{3}}{3}+\frac{x^{5}}{5}-\frac{x^{7}}{7}+\ldots
\end{equation}
Which then allows you to apply your reasoning toward the end to finish with your identity for $\frac{\pi}{4}.$