Solution (source code)

= Solution

Write $\widetilde p_1$ and $\widetilde q$ for the quantities computed from the perturbed second sample. The endpoint <linear interpolation> and its <derivative> are
$$
\widetilde p_1(x)=\frac{x}{h}\bigl(\sin(ah)+a\epsilon\bigr),\qquad
\widetilde q(x)=\frac{\sin(ah)}h+\frac{a\epsilon}{h}.
$$
Compare them on their interpolation <interval> $0\leq x\leq h$, with fixed $a>0$. Put $x=th$, $0\leq t\leq1$. The <Taylor series> of the <sine> gives, uniformly in $t$,
$$
\begin{aligned}
\widetilde p_1(th)-\sin(ath)
&=at\epsilon+\frac{a^3h^3}{6}(t^3-t)+O(h^5),\\
\widetilde q-f'(0)
&=\widetilde q-a=\frac{a\epsilon}{h}-\frac{a^3h^2}{6}+O(h^4).
\end{aligned}
$$
Here the second equality compares with $f'(0)=a$. More generally, the exact <derivative> is $f'(th)=a\cos(ath)$ and
$$
\widetilde q-f'(th)=\frac{a\epsilon}{h}+a^3h^2\left(\frac{t^2}{2}-\frac16\right)+O(h^4).
$$
The input perturbation itself changes the value <interpolant> by exactly $a\epsilon x/h$, and changes its <derivative> by exactly $a\epsilon/h$. Thus
$$
\boxed{\|\widetilde p_1-p_1\|_{\infty,[0,h]}=a|\epsilon|,\qquad
|\widetilde q-q|=\frac{a|\epsilon|}{h}.}
$$
For fixed nonzero $\epsilon$, the value approximation has a bounded noise floor: its maximum error approaches $a|\epsilon|$, and at $x=h$ that error is exactly $a|\epsilon|$. It \b[does not converge uniformly to the exact values] as $h\to0$. However, it does not amplify the absolute sample perturbation on $[0,h]$. The <derivative> error instead grows without bound like $a|\epsilon|/h$.

With exact samples, $\epsilon=0$, both approximations do converge on the shrinking <interval>: the value error is $O(h^3)$ for this particular <sine>, and the <derivative> error is $O(h^2)$. With step-dependent noise, value convergence requires $\epsilon(h)\to0$, whereas <derivative> convergence requires the stronger $\epsilon(h)=o(h)$, where $o$ denotes <little o notation>.

This is <noise amplification by differentiation of a linear interpolant>. Value <interpolation> has an absolute perturbation bound independent of $h$ on the sampled <interval>. Numerical <differentiation> has a perturbation factor $1/h$, expressing the <ill-posedness of numerical differentiation> from values with fixed absolute uncertainty. The amplification follows from the mathematical data map even in exact arithmetic; it is distinct from additional <roundoff error> in a particular implementation. For fixed $x$ outside $[0,h]$, the operation becomes <extrapolation>, and the value perturbation $a\epsilon x/h$ can also diverge.

\Image[/past-exam-of-the-numerical-analysis-course-of-the-university-of-oxford/2015-interpolation-noise-amplification.png]
{title=Fixed sample noise gives a bounded value-error floor while <differentiation> amplifies it as $1/h$}