Skip to main content

Section 6.6 Rational Interpolation and Approximation

We now extend some of the ideas above to that using rational functions instead of polynomials. There are a lot of advantages to using rational functions. First recall that generally good approximate functions only use the four arithmetic operations and rational functions fit this.
Sometimes it seems more difficult to find the rational approximation. There isn’t the nice orthogonal polynomial theory that applies to rationals, but we can still use some of the ideas we’ve learned in this chapter.

Subsection 6.6.1 Padé Approximations

The first rational approximation to a function that we will discuss is that of the Padé approximation. This is the equivalent of the Taylor Series to rational functions.
Recall that a Taylor approximation to a function \(f(x)\) is a polynomial \(P(x)\) such that
\begin{equation*} \begin{aligned}f^{(i)}(x_{0})\amp = P^{(i)}(x_{0}) \qquad \text{for some $x_{0}$ and $i=0,1, \ldots, n$}\end{aligned} \end{equation*}
For example, here’s the approximation using Taylor to \(e^{-x}\text{.}\)

Example 6.6.1.

The Taylor Polynomial \(P_{2}(x)\) to \(f(x)=e^{-x}\) at \(x_{0}=0\) is
\begin{equation*} \begin{aligned}P_{2}(x)\amp = 1 - x + \frac{x^{2}}{2}\end{aligned} \end{equation*}
A Padé approximation is similar to Taylor series, except that a rational function is used. First, defined
\begin{equation*} R_{m,n}(x) = \frac{\sum_{i=0}^{m} a_{i} x^{i}}{\sum_{i=0}^{n} b_{i} x_{i}} = \frac{P_m(x)}{Q_n(x)} \end{equation*}
where generally \(b_{0}=1\text{.}\) Generally the degree of the top and bottom are close to each other.

Definition 6.6.2.

The Padé approximation \(R_{m,n}(x)\) is the rational function that satisfies:
\begin{equation} f^{(i)}(x_{0}) = R^{(i)}_{m,n}(x_0)\tag{6.6.1} \end{equation}
for \(i=0,1,2, \ldots m+n\text{.}\)
This seems reasonable until you might notice that you have to take the derivative of \(R\) a lot of times. Instead generally, if we rewrite (6.6.1) as
\begin{equation*} Q_n(x) R_{m,n}(x) = P_m(x) \end{equation*}
then differentiate this \(i\) times
\begin{equation*} \frac{d^i}{dx^i} \left(Q_n(x) R_{m,n}(x) \right) = P_m^{(i)}(x) \end{equation*}
and evaluate it at \(x=x_0\) replacing \(R^{(i)}_{m,n}(x_0)\) with \(f^{(i)}(x_0)\text{.}\) The following example shows this in action.

Example 6.6.3.

Find the Padé approximation, \(R_{2,2}(x)\) to \(f(x)=e^{-x}\) at \(x_{0}=0\text{.}\)
Solution.
The function \(R_{2,2}(x)\) is
\begin{equation*} R_{1,1}(x) = \frac{a_{0} + a_{1} x + a_2 x^2}{1+b_{1}x + b_2 x^2} \end{equation*}
which can be written in simpler form as
\begin{equation} (1+b_1x +b_2x^2) R_{2,2}(x) = a_{0} + a_{1} x + a_2 x^2\tag{6.6.2} \end{equation}
To find the Padé approximation, we will need a total of 4 derivatives of this equation or
\begin{equation*} \begin{aligned} (1+b_1x + b_2x^2)R'_{2,2}(x) + (b_1 + 2b_2 x) R_{2,2}(x) \amp = a_1 + 2 a_2 x_2 \\ (1+b_1x + b_2x^2)R''_{2,2}(x) + 2 (b_1 + 2b_2 x) R_{2,2}' (x) + 2 b_2 R_{2,2}(x) \amp = 2a_2 \\ (1+b_1x + b_2x^2)R'''_{2,2}(x) + 3 (b_1 + 2b_2 x) R_{2,2}'' (x) + 6 b_2 R'_{2,2}(x) \amp = 0 \\ (1+b_1x + b_2x^2)R''''_{2,2}(x) + 4 (b_1 + 2b_2 x) R_{2,2}''' (x) + 12 b_2 R''_{2,2}(x) \amp = 0 \end{aligned} \end{equation*}
These four equation with the original one in (6.6.2) are then evaluated at \(x=0\) and using \(R_{2,2}^{(i)}(0) = f^{(i)}(0)\)
\begin{equation*} \begin{aligned} e^{0} = 1 \amp = a_0 \\ (-e^{0}) + b_1 (e^0) = -1+b_1 \amp = a_1 \\ (e^0)+ 2b_1 (-e^0) + 2b_2 (e^0) = 1-2b_1 +2b_2\amp = 2a_2 \\ (-e^0) + 3b_1 (e^0) + 6b_2 (-e^0) = -1+3b_1 - 6b_2 \amp = 0 \\ (e^0) + 4b_1 (-e^0) + 12b_2 (e^0) = 1 -4b_1 + 12b_2 \amp = 0 \end{aligned} \end{equation*}
And note that these are all linear, so can be solved with matrix algebra to give:
\begin{equation*} \begin{aligned} a_0 \amp = 1 \\ a_1 \amp = -\frac{1}{12} \\ a_2 \amp = \frac{1}{12} \\ b_1 \amp = \frac{1}{2} \\ b_2 \amp = \frac{1}{12} \end{aligned} \end{equation*}
so
\begin{equation*} \begin{aligned}R_{2,2}(x)\amp = \frac{1-x/12+x^2/12}{1+x/2+ x^2/12}= \frac{12-x+x^2}{12+6x+x^2}\end{aligned} \end{equation*}
A plot of the error between \(f(x)=e^{-x}\) and \(R_{2,2}(x)\) is given by
Figure 6.6.4.
And it is noted that similar to Taylor’s series the approximation matches the function at the point of expansion—in this case at \(x=0\text{.}\) This can be see in the plot above by noticing that the function is very flat near this point.
And similar to Taylor Series, increasing \(n\) will in general decrease the error in the approximation.
Note also that since this is a rational function, there may be places where it is undefined. However, in this case, the zeros of the denominator are not real. The plot below shows that the approximation seems to pass the eyeball test within 2 units.
Figure 6.6.5.

Subsection 6.6.2 A Hermite-Type Rational Approximation

Hermite interpolation was studied in Section 4.4 and recall the resulting polynomial matches both the function value and its derivative. In this section, we do the same.
We write the rational polynomial \(R_{m,n}\) as the quotient of the two polynomials or
\begin{equation*} R_{m,n}(x) = \frac{P_m(x)}{Q_n(x)} \end{equation*}
and for some values \(x_k\text{,}\) we desire \(R_{m,n}(x_k) = f(x_k)\) and \(R'_{m,n}(x)= f'(x)\text{.}\)
For the derivative, instead of using the quotient rule, we write:
\begin{equation} Q_n(x) R_{m,n} (x) = P_m(x)\tag{6.6.3} \end{equation}
and differentiate
\begin{equation} Q_n(x) R'_{m,n}(x)+ Q'_n(x) R'_{m,n} = P'_m(x)\tag{6.6.4} \end{equation}
and then evaluating (6.6.3) and (6.6.4) at \(x_k\) using \(R_{m,n}(x_k) = f(x_k)\)
\begin{align} Q_n(x_k) f(x_k) \amp = P_m(x_k) \tag{6.6.5}\\ Q_n(x_k) f'(x_k)+ Q'_n(x_k) f(x) \amp = P'_m(x_k) \tag{6.6.6} \end{align}
Equations (6.6.5) and (6.6.6) are linear equations in the coefficients of the polynomials \(P_m\) and \(Q_n\text{.}\) And we will show how to solve these equations through an example.

Example 6.6.6.

Find the Hermite-type rational function that interpolates the function \(f(x)= e^{-x}\) on the Chebyshev points for \(n=3\)
Solution.
For \(n=3\text{,}\) we have 6 equations from (6.6.5) and (6.6.6) and need a rational function with 6 unknowns. We will take
\begin{equation*} R_{3,2}(x)= \frac{a_{0}+a_{1} x + a_{2} x^{2} + a_{3} x^{3}}{1 + b_{1} x + b_{2} x^{2}} = \frac{P_3(x)}{Q_2(x)} \end{equation*}
where generally we can take one value known without loss of generalization. Also, the Chebyshev points are found from (6.4.5) as
\begin{equation*} \begin{aligned} x_k \amp = \cos \left( \frac{2k-1}{6}\pi\right), \qquad \text{for $k=1,2,3$} \\ \amp = \frac{\sqrt{3}}{2}, 0, -\frac{\sqrt{3}}{2} \end{aligned} \end{equation*}
and then (6.6.5) and (6.6.6) can be written at these points as
\begin{equation*} \begin{aligned} (1+b_1 x_k + b_2 x_k^2) e^{-x_k} \amp = a_0 + a_1 x_k + a_2 x_k^2 + a_3 x_k^3 \\ -(1+b_1 x_k + b_2 x_k^2) e^{-x_k} + (b_1 + 2 b_2 x_k) e^{-x_k} \amp = a_1 + 2 a_2 x_k + 3 a_3 x_k^2 \end{aligned} \end{equation*}
and it is noted that evaluated at the points \(x_k = -\sqrt{3}/2,0,-\sqrt{3}/2\) that these form 6 linear equations. Although the exact answer can be determined, we resort to floating point and the following is the result:
\begin{equation*} \begin{aligned} a_0 \amp = 0.9999999999999999 \\ a_1 \amp = -0.6014806167056124 \\ a_2 \amp = 0.15051913317216709 \\ a_3 \amp = -0.016489214840168902 \\ b_1 \amp = 0.3985193832943877 \\ b_2 \amp = 0.049114986712004934 \\ \end{aligned} \end{equation*}
A plot of the Rational function with these values appears identical to \(f(x) = e^{-x}\) and a plot of of \(|f(x) - R_{3,2}(x)|\) is shown below
Rational Approximation Error