# Correct use of Weierstrass M-test to show series is uniformly convergent

I need to show that the following function is continuous over $(0, \infty)$:

$$f(x) = \sum_{n=1}^{\infty}{(\cos(nx))^{n^2}\over{(e^x + x)^n}}$$

I have tried showing that the series is uniformly convergent over said interval, using the Weierstrass M-test:

$${(\cos(nx))^{n^2}\over{(e^x + x)^n}} \le {1\over (e^x + x)^n}$$

And since $x \ge 0$, we have:

$${1\over (e^x + x)^n} \le {1\over (e^x)^n}$$

Now, since $\sum_{n=1}^{\infty}{ {1\over (e^x)^n}}$ is a convergent geometric series, as I understand it, it is enough to claim that $f(x)$ is uniformly convergent, and thus continuous over $(0,\infty)$.

But it seems that I am mistaken. The formal solution I was given included showing that

$${1\over (e^x + x)^n} \le {1\over (e^b)^n + b}$$ in the interval $[b,\infty)$ for every $b \ge 0$.

I would appreciate if someone can explain to me why my solution is wrong, or isn't enough.

Thanks.

• Note that the geometrical series you find does not converge for $x=0$ so you can't get uniform convergence on $[0,\infty)$ from this. However to get continuity on $(0,\infty)$ you need to show that it's continuous for any given $x>0$ (but not $0$ itself). Given any $x>0$ there is a $b>0$ such that $b<x$ so you only need to show uniform convergence on $[b,\infty)$ for any $b>0$. – Winther Jul 13 '17 at 13:23

${1\over (e^x + x)^n} \le a_n$ such that the sequence $(a_n)$ is independent of $x$ !!
(and such that $\sum_{n=1}^{\infty} a_n$ is convergent).