show that series $\sum_{n=1}^\infty \frac {(-1)^{n-1}}{n+x^2}$ is uniformly convergent for all real values of x I tried using weirestrass M test .
My method : let $$\ f(x)=\frac {1}{(n+x^2)}\ $$
$$f'(x)= \frac {-2x}{(n+x^2)^2}=0 $$
this gives $x=0 $
$$f''(x)= -2[\frac{(n+x^2)^2 -2(n+x^2)(2x.x)}{(n+x^2)^4}]\ = \frac {-2(n-3x^2)}{(n+x^2)^3}$$ $$f''(x)= \frac {-2}{n^2} \lt 0$$
Thus, f(x)  has a maxima at x=0   $$f(x)_{max} = f(0)= \frac 1n$$
Let $M_{n}$(weirestress M sequence) be $$\frac {1}{n}$$  thus $$f(x) \lt \frac 1n $$
But $$\frac 1n$$ is a diverging sequence thus the series is non uniformly convergent  which is contrary to correct answer(i.e series is uniformly convergent) .
tell my what i'm doing wrong . have i taken $M_{n}$ series wrong ?
 A: As mentioned in the comment, the Weierstrass M-test is only a sufficient condition for the series to converge uniformly. You cannot use this to show that something does not converge uniformly.

Here is a solution: Since $f_n \to 0$ uniformly on $\mathbb{R}$, it suffices to check that
$$ S_{2N}(x) = \sum_{n=1}^{2N} f_n(x) $$
converges uniformly as $N\to\infty$. By pairing up the $(2k-1)$-th term and the $2k$-th term for each $k$,
\begin{align*}
S_{2N}(x)
&= \sum_{k=1}^{N} \left( \frac{1}{2k-1+x^2} - \frac{1}{2k+x^2} \right) \\
&= \sum_{k=1}^{N} \frac{1}{(2k-1+x^2)(2k+x^2)}.
\end{align*}
Now the summand is bounded by $\frac{1}{(2k-1)(2k)}$ uniformly for $x\in\mathbb{R}$, and $\sum_{k=1}^{\infty} \frac{1}{(2k-1)(2k)}$ converges. So you can apply the Weierstrass M-test to conclude.
A: You can rewrite your sum as follows:
\begin{align*}
\sum_{n=1}^{\infty}\frac{1}{2n-1 + x^2} - \frac{1}{2n + x^2}  & = \sum_{n=1}^{\infty} f(2n-1) - f(2n) \\
\end{align*}
where $$f(t) = \frac{1}{t+x^2}$$
The Mean Value Theorem says there is some $c \in (t-1,t)$ for which we have $$f(t-1) - f(t)  = (\frac{d}{dt}f)(c)  =  - \frac{1}{(c+x^2)^2}$$
For $c \in (t-1,t)$ we have that
$$\bigg|- \frac{1}{(c+x^2)^2} \bigg| \leq \frac{1}{(t-1)^2} $$
Let $t = 2n$ and apply the test there.
