Solution (source code)

= Solution

The <Taylor theorem with Lagrange remainder> supplies a point $\xi_i$ between $x_0$ and $X_i=x_0+hZ_i$ such that
$$
g(X_i)=g(x_0)+hZ_i g'(x_0)+\frac{h^2Z_i^2}{2}g''(\xi_i).
$$
Since $Z_i^2=1$ and $Y_i=g(X_i)+\varepsilon_i$,
$$
\boxed{Y_i-g(x_0)=hZ_i g'(x_0)+\frac{h^2}{2}g''(\xi_i)+\varepsilon_i}.
$$