3 Approximating partial derivatives
Earlier, in HELM booklet 31.3, we saw methods for approximating first and second derivatives of a function of one variable. We review some of that material here. If then the forward and central difference approximations to the first derivative are:
and the central difference approximation to the second derivative is:
in which is a small -increment. The quantity is what we previously referred to as , but it is now convenient to use a notation which is more closely related to the independent variable (in this case ). (Examples implementing the difference approximations for derivatives can be found in HELM booklet 31.)
We now return to the subject of this Section, that of partial derivatives. The PDE involves the first derivative and the second derivative . We now adapt the ideas used for functions of one variable to the present case involving .
Let be a small increment of , then the partial derivative may be approximated by:
Let be a small increment of , then the partial derivative may be approximated by:
The two difference approximations above are the ones we will use later in this Section. Example 14 below refers to these and others.
Example 14
Consider the function defined by
Using increments of and , and working to 8 decimal places, approximate
- with a one-sided forward difference
- with a central difference
- with a one-sided forward difference
- with a central difference.
Enter your approximate derivatives to 3 decimal places.
Solution
The evaluations of we will need are , , , , It follows that
to 3 decimal places. (Workings shown to 8 decimal places.)