Does Weierstrass M-test work for unbounded intervals?
I was given the following definition for Weierstrass's M-test :
Let $ u_n : [a,b] \to \mathbb{R} $ and suppose there exists a sequence of numbers $ M_n $ s.t. $ \sum_{n=1}^{\infty} M_n < \infty $ s.t. for all $ x \in [a,b] $ and for all $ n $ it occurs that $ | u_n(x) | \leq M_n $. Then $ \sum_{n=1}^\infty u_n $ converges absolutely and uniformly.
Then I was given the following exercise:
Prove that the series $ \sum_{n=2}^{\infty}{n^2 x^2 e^{-n^2 \cdot x}} $ converges uniformly on $ [ 0 , \infty ) $.
Solution: to find $ \sup_{x\geq 0} u_n(x) $ we'll differentiate and set equal to zero:
$ u_n'(x) = n^2 e^{-n^2 x} ( 2x-n^2 x^2 ) = 0 \longrightarrow x_{min} = 0 , x_{max} = \frac{2}{n^2}$
Therefore,
$ | u_n(x) | \leq u_n(\frac{2}{n^2}) = \frac{4e^{-2}}{n^2}$
And since $ \sum_{n=1}^{\infty} \frac{4e^{-2}}{n^2} $ converges, then by Weierstrass's M-test, the original series also converges.
However, I'm confused because the given definition applies to bounded interval, so I'm wondering... does Weierstrass M-test apply only to bounded intervals? or also to intervals of the form $ [a,\infty) , ( -\infty,b ] , ( -\infty, \infty ) $ ?
Edit: I was confused about the wikipedia definition because it seemed to contradict the above definition I was given in a teacher assistant's class, so just to be sure, I asked the question.