Year: 2000
Paper: 2
Question Number: 5
Course: LFM Pure
Section: Integration
Difficulty Rating: 1600.0
Difficulty Comparisons: 0
Banger Rating: 1470.2
Banger Comparisons: 2
It is required to approximate a given function $\f(x)$,
over the interval $0 \le x \le 1$,
by the linear function $\lambda x$, where $\lambda$ is chosen
to minimise
\[
\int_0^1 \big(\f(x)-\lambda x \big)^{\!2} \,\d x .
\]
Show that
\[
\lambda = 3 \int_0^1 x\f(x)\,\d x.
\]
The residual error, $R$, of this approximation process is
such that
\[
R^2 = \int_0^1 \big(\f(x)-\lambda x \big)^{\!2}\,\d x.
\]
Show that
\[
R^2 = \int_0^1 \big(\f(x)\big)^{\!2}\,\d x -\tfrac{1}{3}
\lambda ^2.
\]
Given now that
$\f(x)= \sin (\pi x/n)$,
show that \textbf{(i)} for large
$n$, $\lambda \approx \pi/n$ and \textbf{(ii)}
$\lim_{n \to \infty}R = 0.$
Explain why, prior to any calculation, these results are to be
expected.
[You may assume that, when $\theta$ is small,
$\sin \theta
\approx \theta-\frac{1}{6}\theta^3$ and
$\cos \theta \approx 1 - \frac{1}{2}\theta^2.$]
\begin{align*}
&& g(\lambda) &= \int_0^1 \big(\f(x)-\lambda x \big)^{\!2} \,\d x \\
&&&= \int_0^1 \left ( f(x)^2 -2\lambda xf(x) + \lambda^2 x^2\right) \d x \\
&&&= \frac13\lambda^2 - 2\lambda \int_0^1 x f(x) \d x + \int_0^1 f(x)^2 \d x \\
\end{align*}
Differentiating (or completing the square) it is clear the minimum occurs when $\displaystyle \lambda = 3 \int_0^1 xf(x) \d x$
\begin{align*}
&& R^2 &= \int_0^1 (f(x) - \lambda x )^2 \d x \\
&&&= \frac13\lambda^2 - 2\lambda \int_0^1 x f(x) \d x + \int_0^1 f(x)^2 \d x \\
&&&= \frac13 \left (\lambda -3\int_0^1 xf(x) \d x \right)^2 -\frac13 \left ( 3\int_0^1 xf(x) \d x \right)^2+\int_0^1 f(x)^2 \d x \\
\end{align*}
When $\lambda = 3\int_0^1 xf(x) \d x $ clearly this is the desired result.
\begin{align*}
&& \lambda &= 3\int_0^1 xf(x) \d x \\
&&&= 3\int_0^1 x \sin(\pi x /n) \d x \\
&&&= 3 \left [-x \frac{n}{\pi} \cos (\pi x /n) \right]_0^1 + \frac{3n}{\pi} \int_0^1 \cos(\pi x /n) \d x \\
&&&= -\frac{3n}{\pi}\cos(\pi/n) + \frac{3n}{\pi} \left [ \frac{n}{\pi} \sin(\pi x /n)\right]_0^1 \\
&&&= -\frac{3n}{\pi} \cos(\pi/n) + \frac{3n^2}{\pi^2} \sin(\pi /n) \\
\text{for large }n: &&&\approx -\frac{3n}{\pi}\left ( 1 - \frac12\frac{\pi^2}{n^2} + o(1/n^4)\right) + \frac{3n^2}{\pi^2} \left (\frac{\pi}{n} - \frac16 \frac{\pi^3}{n^3} +o(1/n^5) \right) \\
&&&= \left (\frac32 -\frac12\right)\frac{\pi}{n} + o(1/n^3) \\
&&&= \frac{\pi}{n} + o(1/n^2)
\end{align*}
Therefore for large $n$, $\lambda \approx \frac{\pi}n$
\begin{align*}
&& \int_0^1 \sin^2(\pi x/n) \d x &= \frac12\int_0^1(1- \cos(2\pi x/n)) \d x\\
&&&= \frac12\left ( 1 - \frac{n}{2\pi}\left[\sin(2\pi x/n) \right]_0^1 \right) \\
&&&= \frac12 -\frac{n}{4\pi}\sin(2\pi /n) \\
\\
&& R^2 &= \frac12 -\frac{n}{4\pi}\sin(2\pi /n) - \frac13 \left ( \frac{\pi}{n}+o(1/n^2)\right)^2 \\
&&&= \frac12 - \left ( \frac{1}{2} -\frac16\frac{\pi}{n}+o(1/n^3) \right) - o(1/n^2) \\
&&& = \frac16 \frac{\pi}{n} + o(1/n^2) \\
&&&\to 0 \text{ as } n \to \infty
\end{align*}
We should expect these results as for $n$ very large $\sin(\pi x/n) \approx \frac{\pi }{n}x$ so the best linear approximation is likely to be $\lambda = \frac{\pi}{n}$ and we should expect it to improve to the point that we cannot tell the difference, ie $R^2 \to 0$