Convergence of sequence of functions, $f_n(x) = n^2 x(1-nx) \dots $ Doing an exercise for exam preparation, I stumbled across the following function:
$f_n(x)=  n^2x(1-nx),  \quad \text{if }0 \leq x \leq \frac{1}{n} $
$f_n(x)=  0, \quad \text{if } \frac{1}{n} < x \leq 1$
The task is to find the limit of this function series and to determine whether this function converges uniformly in $[0,1]$
On the one hand $\frac{1}{n}$ approaches $0$ for $n \to \infty$. So one would just have to insert $0$ in $n^2x(1-nx)$. Thereby gaining $f_n(x) = 0$ for $n \to \infty$.
On the other hand the function has a maximum for $x=\frac{n}{2}$. Putting this into $n^2x(1-nx)$ and calculating $f_n(x)$ for $n \to \infty$ afterwards one gets $f_n(x) = \infty$.
So whats correct? How does one approach such a problem?
Thanks in advance
ftiaronsem
 A: I'd strongly encourage you to draw a picture of the graph of $f_{n}$.
Your argument that $f_{n} \to 0$ is not quite correct. I'd argue as follows:
We have $f_{n}(x) \to 0$ as $(n \to \infty)$ for all $x \in [0,1]$. This is clear for $x = 0$ and for $x > 0$ we have $f_{n}(x) = 0$ for all $n$ so large that $\frac{1}{n} < x$.
If $f_{n} \to f$ uniformly on $[0,1]$ then $f_{n} \to f$ pointwise, hence we must have $f = 0$. 
On the other hand, the function $f_{n}$ has a maximum at $\frac{1}{2n}$ (not $\frac{2}{n}$ as you've written in your question) as can be found by differentiation, for example. Evaluation gives
\[
f_{n}(\frac{1}{2n}) = n^{2} \frac{1}{2n} ( 1 - n\frac{1}{2n}) = \frac{n}{4}
\]
Therefore
\[
\sup_{x \in [0,1]} |f_{n}(x) - f(x)| = \sup_{x \in [0,1]} |f_{n}(x)| = \frac{n}{4} \xrightarrow{n \to \infty} \infty
\]
and hence $f_{n}$ does not converge uniformly to $f = 0$.
A: Another way to proceed is to look at the area of the function in your domain $[0,1]$. (I usually use this as a first step to check if the function is not uniformly convergent, since it is relatively easy.)
The area of the function $f_n(x)$ in the domain is $\frac{1}{2}-\frac{1}{3} = \frac{1}{6}$ irrespective of $n$.
Note that $f_n(0) = 0, \forall n$ and $\displaystyle \lim_{n \rightarrow \infty} f_n(x) = 0$, $\forall x \in (0,1]$. 
This can be seen since for any $x$, $\exists N \in \mathbb{N}$ such that $\forall n > N$, $\frac{1}{n} < x \Rightarrow f_n(x) = 0$.
Hence, $f(x) = \displaystyle \lim_{n \rightarrow \infty} f_n(x) = 0$, $\forall x \in [0,1]$.
So we have $\displaystyle \int_{0}^{1} f_n(x) dx = \frac{1}{6}$, $\forall n \in \mathbb{N}$ and $\displaystyle \int_{0}^{1} f(x) dx = 0$. So we have $$\displaystyle \lim_{n \rightarrow \infty} \int_{0}^{1} f_n(x) dx = \frac{1}{6} \neq 0 = \displaystyle \int_{0}^{1} f(x) dx$$
Hence, we have $\displaystyle \lim_{n \rightarrow \infty} \int_{0}^{1} f_n(x) dx \neq \displaystyle \int_{0}^{1} \lim_{n \rightarrow \infty} f_n(x) dx$
And we know that if a sequence of functions converge uniformly, we can swap the limit and the integrals to get the same integral.
Hence, the function is not uniformly convergent.
A: The limit function is $f(x) = 0 \quad \forall x \in [0,1]$ because, as $n \rightarrow \infty$ you have that the region where the sequence is $n^2 x(1-nx)$ is always smaller and smaller (this is a nice way of approaching sequences with boundary conditions that involve $n$). 
As for uniform convergence, you should take the supremum for $x \in [0,1]$ and since the function has a maxmimum inside the interval, you can say that $\sup_{x \in [0,1]}\left| n^2 x(1- n x)\right| = \frac{n}{4}$, and if $n \rightarrow \infty$ it doesn't approach zero, so the convergence is not uniform.
A: If one has to justify the existence of the absolute maximum of $\:f_n,\:$ the following'd be non trivial.
$$\text{For }\:n\in \mathbf N,\:]0,1[\:\ni u<x,\\ f_n(x)-f_n(u)=\underbrace{(n^2-n^3x-n^3u)}_{\varphi_n(x)}(x-u).\\\implies{f_n(x)-f_n(u)\over x-u}=\varphi_n(x).$$
$\varphi_n(x)\:$ being polynomial justifies its continuity so that
$$\varphi_n(u)=\lim_{x\to u}\varphi_n(x)=\lim_{x\to u}{f_n(x)-f_n(u)\over x-u}=:f^{\large'}_n(u)=n^2-2n^3u,\:\:\forall n\in\mathbf N.$$
Thus, $\:f_n\:$ is differentiable on $\:[0,1].$
Now,  $\:f^{\large'}_n(x)=0\iff x_n=1/{2n}\:\:\:\&\:\:f_n(x_n)=n/4.$
We hope that $\:f_n\:$ attains its absolute maximum at $\:x_n:$
$$\forall\delta>0\:\:\exists\mathcal{\:N}_\delta(x_n)=\left]\frac{1}{2n}-\delta,\frac{1}{2n}+\delta\right[:f^{\large'}_n(y)\ge0\:\:\text{ for }\:\frac{1}{2n}-\delta<y<\frac{1}{2n},\\\text{and }\:\: f^{\large'}_n(y)\le0\:\:\text{ for }\:\frac{1}{2n}<y<\frac{1}{2n}+\delta.$$
For the increasing part, we must have that $\:\left|y+\frac{\delta}{2}\right|<\frac{1-n\delta}{2n}.$
Let's choose $\:y=\large{1-n\delta\over 2n}\normalsize\implies f^{\large'}_n(y)=n^3\delta>0$
For the decreasing part, we must have that $\:\left|y-\frac{\delta}{2}\right|<\frac{1+n\delta}{2n}.$
Let's choose $\:y=\large{1+n\delta\over 2n}\normalsize\implies f^{\large'}_n(y)=-n^3\delta<0.$
So that $\:f_n\:$ attains $\text{a relative maximum}\:$ at $\:x_n=1/{2n}.\:$
But since $\:\delta\:$ must be arbitrarily chosen small, whenever $\:\delta=1/{2n},\:$ our neighbourhood $\:\mathcal N_\delta(x_n)\:$ becomes asymptotically equivalent to $\:]0,1/n[\:\subset[0,1],\:$ for some $\:n\ge N\ge1$.
Therefore $\:f_n\:$ attains $\text{its absolute maximum}\:$ at $\:x_n=1/{2n}.\:$
