4. (a) Using Taylor series, determine the coefficients a, b and c such that the approx-
imation
f'(0) ? af(2h) + bf(0) + cf(-h)
will be second order accurate.
(b) Consider the following boundary value problem
(x + 1)u''(x) + u'(x) + u(x) = 0,
0 < x < 1
(1)
with boundary conditions
u'(0) = 1, u(1) = 1.
We will use a uniform discretisation of [0, 1] with spacing ?x and n + 1 grid
points, i.e. 0 = x? < x? < ... < x??? < x? = 1. You need to use a second
order accurate Finite Difference discretisation for (1).
i. Use a second order approximation to discretise the Neumann boundary
condition and write down the expression for the ghost point u??.
ii. How large will your system be?
iii. Write down the equation for i = 0.
iv. Write down the general form for the rest of the equations in the system,
i.e. for i = 1, ..., n - 1.