Finding $ \lim_{n\to\infty}\int_{0}^{\pi}x\left|\sin 2nx\right|\,dx$ $$ \lim_{n\to\infty}\int_{0}^\pi x\left\vert \sin2nx\right\vert \, dx$$
So in this question what I tried to visualise is that since integration here is just like finding the area under the graph of the function x$\vert \sin2nx \vert$ and as $\lim_{n\to\infty}$, as n increase, it starts covering more and more area under the graph $y=x$ , and at infinity, the function can be visualised like covering the whole area under the graph of $ y = x $ from $0 \to π$ , so it should just be $$\int_{0}^\pi x dx$$ which is just $\frac{π^2}{2} $but it is not , just 

$\pi$

What is the error here ??
[ This might appear weird, but it confused me a bit because I'm still in highschool and still new to Calculus ]
 A: When $n$ is large, the integral is roughly the same as $\int_0^\pi kx\,dx$ where $k$ is the average value of $|\sin x|$ over a period.
This average value is $\frac2{\pi}$, which eats one of the factors of $\pi$ in the triangle (and also cancels out the $\frac12$.

This trick is pretty specific to cases of the shape $$\lim_{n\to\infty} \int f(x) g(nx) dx$$ where $g$ is periodic such that the integral is scaled by wiggles that becomes ever narrower.
When $n$ is large, we can take the integral over each period of $g$ separately -- and because the wiggles are narrow enough, $f(x)$ is almost constant over each of them, so we can put it outside an inner integral. When the period is the the same as the width of the integral this goes like
$$ \int_0^P f(x)g(nx) dx = \sum_{j=0}^{n-1} \int_{j P/n}^{(j+1)P/n} f(x)g(nx)\; dx \approx \sum_{j=0}^{n-1} f(j\tfrac Pn) \int_{jP/n}^{(j+1)P/n} g(nx) \,dx $$
After you evaluate the inner integral (which is now the same in each term thanks to periodicity), what you have left is just a Riemann sum for the integral of $f(x)$ scaled by the (common) average of the wiggles. So that's the integral we get when we let $n$ go to $\infty$.
To make this rigorous you need to estimate the error that arises at the $\approx$ in the above calculation -- but it is fairly easy to see that it must go to zero if $f$ is uniformly continuous and $g$ is bounded.
A: Here’s a pretty simple way to solve this problem.
I assume you know that $\int_a^bf(x)dx = \int_a^bf(a+b-x)$.
Now, I $= \lim_{n\to\infty} \int_0^{\pi}x|\sin(2nx) |dx$.
Applying the above identity,
I $= \lim_{n\to\infty} \frac{\pi}{2}\int_0^{\pi}|\sin(2nx) |dx$.   (Since $|\sin(x)|$ = $|\sin(2n\pi - x)|$)
Now, because $\sin(x)$ is periodic, we can write the integral as
I $= \lim_{n\to\infty} \frac{n\pi}{2}\int_0^{\frac{\pi}{n}}|\sin(2nx) |dx$.
Substituting $t = 2nx$,
I $= \lim_{n\to\infty} \frac{\pi}{4}\int_0^{2\pi}|\sin(t)|dt$.
Clearly, $\int_0^{2\pi}|\sin(x) |dx$ = 4, which means,
I $= \pi$.
QED
A: Breaking it into intervals you have:
$$\begin{align}\int_{0}^{\pi}x|\sin(2n\pi)|dx&=\sum_{i=0}^{2n-1}\int_{\frac{i\pi}{2n}}^{\frac{(i+1)\pi}{2n}} x|\sin(2n\pi)|dx\\
&=\sum_{i=0}^{2n-1}\int_{0}^{\frac{\pi}{2n}} (x+\frac{i\pi}{2n})|\sin(\pi i + 2nx)|dx\\
&=2n\int_0^{\pi/(2n)}x|\sin(2nx)|dx + \frac{2n(2n-1)}{2}\frac{\pi}{2n}\int_0^{\pi/(2n)}|\sin(2nx)|dx\\
&=2n\int_0^{\pi/(2n)}x\sin(2nx)dx + \frac{(2n-1)\pi}{2}\int_0^{\pi/(2n)}\sin(2nx)dx\end{align}$$
The last step because $\sin(2nx)$ is non-negative for $x\in[0,\pi/(2n)].$
Letting $u=2nx$ then $du=2n\,dx$ and you have that this is equal to:
$$\frac{1}{2n}\int_{0}^{\pi} u\sin u du+\frac{(2n-1)\pi}{4n}\int_{0}^{\pi}\sin(u)du.$$
So the limit is $$\frac{\pi}{2}\int_{0}^{\pi}\sin(u)du=\pi.$$

The same argument shows more generally if $f$ has period $\alpha$ then:
$$\lim_{n\to\infty}\int_{0}^{\alpha}x f(2nx)dx=\frac{\alpha}{2}\int_0^{\alpha}f(u)du.$$
which is the general rule that Henning mentioned in his answer, since this result is $\frac{\alpha^2}{2}$ times the average value of $f$ on $[0,\alpha].$
A: $(x\cos(x))'
=\cos(x)-x\sin(x)
$
so
$\int x\sin(x) dx
=\int \cos(x) dx - x\cos(x)
=\sin(x)-x\cos(x)
$.
Therefore
$\begin{array}\\
\int_{0}^\pi x|\sin2nx|dx
&=\int_{0}^{2\pi n} (y/2n)|\sin y|dy/(2n)
\qquad x = y/(2n)\\
&=\frac1{4n^2}\int_{0}^{2\pi n} y|\sin y|dy\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\int_{2\pi k}^{2\pi(k+1)} y|\sin y|dy\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\int_{0}^{2\pi} (y+2\pi k)|\sin (y+2\pi k)|dy\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\int_{0}^{2\pi} (y+2\pi k)|\sin (y)|dy\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(\int_{0}^{\pi} y|\sin (y)|dy+\int_{\pi}^{2\pi} y|\sin (y)|dy\\
+2\pi k\int_{0}^{\pi} |\sin (y)|dy+2\pi k\int_{\pi}^{2\pi} |\sin (y)|dy\right)\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(\int_{0}^{\pi} y\sin (y)dy-\int_{\pi}^{2\pi} y\sin (y)dy\\
+2\pi k\int_{0}^{\pi} \sin (y)dy-2\pi k\int_{\pi}^{2\pi} \sin (y)dy\right)\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(\int_{0}^{\pi} y\sin (y)dy-\int_{0}^{\pi} (y+\pi)\sin (y+\pi)dy\\
+2\pi k\int_{0}^{\pi} \sin (y)dy-2\pi k\int_{0}^{\pi} \sin (y+\pi)dy\right)\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(\int_{0}^{\pi} y\sin (y)dy+\int_{0}^{\pi} (y+\pi)\sin (y)dy\\
+2\pi k\int_{0}^{\pi} \sin (y)dy+2\pi k\int_{0}^{\pi} \sin (y)dy\right)\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(\int_{0}^{\pi} y\sin (y)dy+\int_{0}^{\pi} y\sin (y)dy+\int_{0}^{\pi} \pi\sin (y)dy+8\pi k\right)\\
&=\frac1{4n^2}\sum_{k=0}^{n-1}\left(2\int_{0}^{\pi} y\sin (y)dy+2\pi+8\pi k\right)\\
&=\frac1{4n^2}\left(2n\int_{0}^{\pi} y\sin (y)dy+2n\pi+4\pi n(n-1)\right)\\
&=\frac1{4n^2}\left(2n(\sin(x)-x\cos(x))|_{0}^{\pi}+2\pi n(2n-1)\right)\\
&=\frac1{2n}\left(\pi+\pi (2n-1)\right)\\
&=\frac1{2n}\left(2n\pi\right)\\
&=\pi\\
\end{array}
$
A: In functional analysis this is called weak convergence.  For example, $\sin nx \to 0$ because we have that:
$$ \lim_{n \to \infty} \int_0^{2\pi} g(x) \,\sin 2\pi n x \,  dx  = 0 $$
For any $g(x) \in L^2([0,2\pi])$ (square-integrable periodic function).  This is called the Riemann-Lebesgue Lemma.  
We could argue that $0< \sin^2 2\pi n x < 1$ and a cursory look at the graph shows $\sin^2 n x$ weak-converges $\to \frac{1}{2}$.  

Here's the graph for $g(x) = x \, |\sin n x|$ and notice the average is somewhat different.  

Riemann Integration no longer works here, since we can make the integeral behave however we like by choosing a partition and a sampling point.  The Riemann sum does not tell us which point in the interval:
$$ \sum f(x_i) \Delta x_i \to \int f(x) \, dx $$
Normally, the midpoint rule (or trapezoid rule or your choice) would give us an upper bound to the uncertainty of the integral, such as:
$$ \big| \int f(x) \, dx - \left( f( \frac{\Delta x}{N}) + \dots + f(2\pi) \right)\Delta x \big| \leq \frac{ (2\pi)^3}{24 N^2} \max_{x \in [0, 2\pi]} \cdot |f''(x)| $$
We can choose the sampling points so that $f(x_i) \equiv 0$ always or $f(x_i) \equiv x$ always or somewhere in between.  So the word "integral" here is ambiguous.  
Limits of Riemann integrals lead to ambiguities, our choice of integration technique started to matter, so that's why weak-approximation requires Lebesgue integration.
