Consider the following family of functions \begin{equation} f_n(x)=\left\{\begin{array} \{ 0 & if\;x<0\\ nx & if\;0\leq x\leq 1/n\\ 1\;& if \;1/n<x \end{array}\right. \end{equation} defined for any $n\in\mathbb{N}$, with the weak derivative \begin{equation} f_n'(x)=\left\{\begin{array} \{ 0 & if\;x<0\\ n & if\;0\leq x\leq 1/n\\ 0\;& if \;1/n<x \end{array}\right. \end{equation} Let $f$ be defined as \begin{equation} f(x)=\left\{\begin{array} \{ 0 & if\;x<0\\ 1\;& if \;x\geq 0 \end{array}\right. \end{equation} such that $f_n$ converges uniformely to $f$ on $L^2(-1,1).$
I want to show that for all $\phi \in C_0^1(-1,1)$, $$\int_{-1}^{1}f_n'\phi dx\longrightarrow\phi(0)$$
Here $\phi$ is a test function used to derive the weak derivative form such that $$\int_{-1}^1f_n\phi'(x)dx=-\int_{-1}^1f_n'\phi(x)dx.$$ So then since we have uniform convergence, I can interchange the limit and the integral. But $f(x)$ does not admit weak derivative, so this is where I am getting confused. I know that weak derivative of $f$ would have to satisfy $$\int f'\phi dx=\phi(0)\;\forall \phi \in C_0^1(-1,1),$$ and so I know that the answer is pretty close, but I am not if I should have $\lim_{n\rightarrow \infty}f_n'=\delta$ where the Dirac Delta function arrives naturaly as the limit of $f_n'$. I guess then Dirac delta function can be seen as the derivative of the Heaviside function $f$, but how is this allowed?
You can calculate directly: if $\psi$ is an antiderivative for $\phi$, \begin{align*} \int_{-1}^1f_n'\phi(x)dx=\int_{0}^{1/n}n\,\phi(x)dx=\frac{\psi(1/n)-\psi(0)}{1/n}\xrightarrow[n\to\infty]{}\psi'(0)=\phi(0). \end{align*}
Alternatively, since $f_n\to f$ in $L^2$, Cauchy-Schwarz gives you $$ \bigg|\int_{-1}^{1}f_n\,\phi '-\int_{-1}^{1}f\,\phi\bigg|= \bigg|\int_{-1}^{1}(f_n-f)\,\phi'\bigg|\leq\|f_n-f\|_2\,\|\phi'\|_2\xrightarrow[n\to\infty]{}0, $$ so $$ \int_{-1}^{1}f_n\,\phi'\xrightarrow[n\to\infty]{}\int_{-1}^{1}f\,\phi' =\int_{0}^{1}\phi'=-\phi(0). $$