Let $a>0$ and $f(x):\mathbb{R}\rightarrow\mathbb{R}$ with
$$f(x):\begin{cases}\frac{1}{\sqrt{a^2-x^2}},& x\in(-a,a)\\ 0,&\text{else} \end{cases}$$ I now have to construct sequences of functions $(f_n)_{n\in\mathbb{N}}\in C_c(\mathbb{R})$ with $f_n\uparrow f$ (meaning $f_n \leq f_{n+1}$) to later show, that the integral of $f$ is equal to the improper integral of $f\in (-a,a)$. I think I'll be able to solve the integral part, but I'm insecure building this sequence of functions. I think I do know how it must look like :
Let $$f_n:\begin{cases}f,& x\in(-a+\frac{1}{n},a-\frac{1}{n})\\ \text{at $x=a-\frac{1}{n}$}\text{is} f(x)=\frac{1}{\sqrt{2a\frac{1}{n}-\frac{1}{n^2}}},&\text{so it should go straight down to 0 in $[a-\frac{1}{n},a)$}\\\text{at $x=-a+\frac{1}{n}$}\text{is $f(x)=\frac{1}{\sqrt{2a\frac{1}{n}-\frac{1}{n^2}}}$},& \text{the same reasoning}\\0,& x\notin]-a,a[ \end{cases}$$ I think that is pretty much correct, as $n\rightarrow\inf$ we get that $f_n\rightarrow f$. However I am not sure how to build the last part.
EDIT: While writing all this I thought of the simple function $f(x)=mx$ where $m=\frac{y_2-y_1}{x_2-x_1}$. For the two points $(-a+\frac{1}{n},f(-a+\frac{1}{n}))(=(x_1,y_1)$ and ($-a,0)(=x_2,y_2)$ and got $m=\frac{\frac{1}{\sqrt{2a\frac{1}{n}-\frac{1}{n^2}}}}{\frac{1}{n}}$. Then I would have my compact sequence of function. Is this correct or is it $-m$ ?