Uniform Convergence of the series $f(x)=\sum_{n=1}^{\infty} \frac{(\cos nx)^{n^2}}{(e^x+x)^n}$ Let $f(x)=\sum_{n=1}^{\infty} \frac{(\cos nx)^{n^2}}{(e^x+x)^n}$
Does f(x) uniformly converge in $(0, \infty)$ ?
I used the Weierstrass M-test to prove that $f(x)$ uniformly converges in $[a,\infty)$ for each $a>0$.
Is there any particular argument which I need to note when saying that $(0,\infty)$ is the same range as $[a,\infty)$ ?
Thanks!
 A: The following is a well-known result:

Suppose that a sequence of functions $(f_n): D \subset \Bbb R \to \Bbb R$ is uniformly convergent on $D$ to a function $f$. Let $a$ be a cluster point of $D$. If for each $n \in \Bbb N$, $\lim_{x \to a} f_n(x)$ exists and equals $b_n$, then:

*

*$(b_n)$ is convergent.


*$\lim_{x \to a} f(x)$ exists and equals $\lim_{n \to \infty} b_n$.

Take $(f_n)$ to be the sequence of partial sums of your series and consider $a = 0$. We have for all $n$, $b_n = n$, hence $(b_n)$ does not converge and the convergence is not uniform on $(0,\infty)$.
A: I am unsure if it is appropriate to post this as an answer, since a similar question was given a similar answer in the post Prove or disprove: $\sum_{n=0}^\infty e^{-|x-n|}$ converges uniformly in $(-\infty,\infty)$. 
As remarked there, if the series converged uniformly on $(0, \infty)$, then the functions $g_n(x) = \cos(n x)^{n^2} / (e^x+x)^n$ would converge uniformly to $0$ on $(0, \infty)$. 
However, while the functions $g_n$ do converge to $0$ pointwise, the convergence is not uniform. Indeed, for each fixed $n \geq 1$, we have $\lim_{x \to 0^+} g_n(x) = g_n(0) = 1$ since $g_n$ is continuous on $[0, \infty)$. In particular, this implies that $\sup_{x\in (0,\infty)} |g_n(x) |\geq 1$. This in turn implies
$$
\lim_{n \to \infty} \;\sup_{x \in (0, \infty)} |g_n(x)| \geq 1
$$
So the $g_n$ do not converge uniformly to $0$ on $(0, \infty)$, since in this case we would have $\lim_{n\to \infty} \sup_{x \in (0 , \infty)} |g_n(x)| =0$.
