2.9 Approximation

Definition 2.9.1. A function \(S:\, I \longrightarrow \mathbb {R}\) where \(I\subseteq \mathbb {R}\) is called a simple function if \(S\) assumes only a finite number of distinct values on \(I\). That is each value is assumed on one or more sub - intervals of \(I\).

Example 2.9.2. Let \(I = [-2, 4]\). Define \(S:\, I \longrightarrow \mathbb {R}\) by

\[ S(x) = \begin {cases} 0 & \text {if}\hspace {0.3cm} -2\leq x < -1\\\\ 1 & \text {if}\hspace {0.3cm} -1\leq x \leq 0\\\\ 1/2 & \text {if} \hspace {0.3cm} 0 < x <1/2\\\\ 3 & \text {if} \hspace {0.3cm} 1/2\leq x < 1\\\\ -2 & \text {if}\hspace {0.3cm} 1\leq x \leq 3\\\\ 2 & \text {if}\hspace {0.3cm} 3 < x\leq 4\\ \end {cases} \]

Then \(S(x)\) is a step function whose graph is.

--1234−−--−−−1232112

Theorem 2.9.3. Let \(I\) be a closed bounded interval and \(f:\, I \longrightarrow \mathbb {R}\) be continuous on \(I\). If \(\varepsilon > 0\), then there exists a step function \(S_{\varepsilon }:\, I\longrightarrow \mathbb {R}\) such that \(\begin {vmatrix} f(x) - S_{\varepsilon }(x)\\ \end {vmatrix} < \varepsilon \) for all \(x\in I\).

Proof. Since \(f\) is continuous on a closed bounded interval \(I\), it is uniformly continuous there. Thus for every \(\varepsilon > 0\) there exists \(\delta (\varepsilon )> 0\) such that if \(x,\, y\in I\) and \(\begin {vmatrix} x - y\\ \end {vmatrix} < \delta (\varepsilon )\) then \(\begin {vmatrix} f(x) - f(y)\\ \end {vmatrix} < \varepsilon \). Let \(I = [a,b]\) and let \(m\in N\) be sufficiently large so that \(h = \dfrac {b - a}{m} < \delta (\varepsilon )\). We divide \(I\) into \(m\) disjoint intervals of length \(h\). i.e \(I_1 = [a, a+h]\) and \(I_k = \big [\big (a + (k-1)\big ), a + h\big ]\) for \(k = 1,\, 2,\, \cdots \cdots , m\). Since the length of each sub interval \(I_k\) is \(h < \delta (\varepsilon )\) if \(x,\, \in I_k\) then \(\begin {vmatrix} x -y\\ \end {vmatrix}\leq h < \delta (\varepsilon )\), consequently \(\begin {vmatrix} f(x) - f(y)\\ \end {vmatrix} < \varepsilon \).
We now define \(S_{\varepsilon }(x) = f(a + kh)\hspace {0.2cm} x\in I_k,\, k = 1,\, 2,\, \cdots \cdots ,\, m\) so that \(S_{\varepsilon }\) is constant on each interval \(I_k\). Then, if \(x\in I_k\) we have \(\begin {vmatrix} f(x) - S_{\varepsilon }(x)\\ \end {vmatrix} = \begin {vmatrix} f(x) - f(a + kh)\\ \end {vmatrix} < \varepsilon \). Therefore, we have \(\begin {vmatrix} f(x) - S_{\varepsilon }(x)\\ \end {vmatrix} < \varepsilon \) for all \(x\in I\).

Definition 2.9.4. Let \(I = [a,b]\) be an interval. The function \(g:\, I \longrightarrow \mathbb {R}\) is said to be piece wise linear on \(I\) if \(I\) is the union of a finite number of disjoint intervals \(I_1,\, I_2,\, \cdots \cdots ,\, I_n\), such that the restriction of \(g\) to each interval \(I_k\) is a linear function.

Theorem 2.9.5. Let \(I\) be a closed bounded interval and let \(f:\, I\longrightarrow \mathbb {R}\) be continuous on \(I\). If \(\varepsilon >0\), then there exists a continuous piece wise linear function \(g_{\varepsilon }:\, I \longrightarrow \mathbb {R}\) such that \(\begin {vmatrix} f(x) - g_{\varepsilon }(x)\\ \end {vmatrix} < \varepsilon \) for all \(x\in I\).

Proof. Since \(f\) is uniformly continuous on \(I = [a,b]\) there is a \(\delta (\varepsilon ) > 0\) such that if \(x,\, y\in I\) and \(\begin {vmatrix} x - y\\ \end {vmatrix} < \delta (\varepsilon )\) then \(\begin {vmatrix} f(x) - f(y)\\ \end {vmatrix} < \varepsilon \). Let \(m \in \mathbb {N}\) be sufficiently large so that \(h = \dfrac {b - a}{m} < \delta (\varepsilon )\). Divide \(I\) into \(m\) disjoint intervals of length \(h\). i.e \(I_1 = [a, a+ h]\) and
\(I_k = \big (a + (k - 1)h\, ,\, a + kh\big )\, ,\, k = 2,\, 3,\, \cdots \cdots , m\). On each interval \(I_k\) we define \(g_{\varepsilon }\) to be linear function joining the points \(\big (a + (k - 1)h\, ,\, f(a + (k - 1)h\big )\) and \(\big (a + kh\, ,\, f(a + kh)\big )\). Then \(g_{\varepsilon }\) is continuous piece wise linear function on \(I\). Since for \(x\in I_k,\, f(x)\) is within \(\varepsilon \) of \(f\big (a + (k - 1)\, h\big )\) and \(f\big (a + k\,h\big )\) for all \(x\in I_k\). \(g_{\varepsilon }(x) \leq \max \big [f\big (a + (k -1)\, h\big )\, , \, f\big (a + k\, h\big )\big ]\) and \(g_{\varepsilon }(x) \geq \min \big [f\big (a + (k - 1)\, h\big )\, ,\, f\big (a + k\, h\big )\big ]\). This shows that \(\begin {vmatrix} f(x) - g_{\varepsilon }(x)\\ \end {vmatrix} < \varepsilon \) for all \(x\in I_k\). Therefore this inequality holds for all \(x \in I\).

We state without proof.

Theorem 2.9.6 (Weierstrass Approximation Theorem). Let \(I = [a,b]\) and let \(f:\, I\longrightarrow \mathbb {R}\) be continuous. If \(\varepsilon > 0\) is given, then there exists a polynomial function \(P_{\varepsilon }\) such that \(\begin {vmatrix} f(x) - P_{\varepsilon }(x)\\ \end {vmatrix} < \varepsilon \) for all \(x\in I\).


Proof. A continuous function on the closed bounded interval \([a,b]\) is uniformly continuous, so given \(\varepsilon >0\) there is \(\delta >0\) with \(\left |f(x)-f(y)\right |<\varepsilon \) whenever \(\left |x-y\right |<\delta \).

Choose \(n\) with \((b-a)/n < \delta \) and take the partition of \([a,b]\) into \(n\) equal subintervals. On each subinterval any two points are within \(\delta \), so the oscillation of \(f\) there is at most \(\varepsilon \). Defining a step function equal to \(f\) at the left endpoint of each subinterval gives a function within \(\varepsilon \) of \(f\) throughout, which is the required approximation. □

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.