Our objective is to expand in a continued fraction a rational function of the form
.
We can write

with

and
.
In a similar manner, we continue:

where the last formula may be rewritten in the form

The continued fraction expansion expression now becomes

If the expressions in the numerator and denominator of f(x) are polynomials, this process will be a terminating continued fraction and yield lower order rational functions as approximations to f(x).
Expand into rational functions the fraction
![]()
A computer program can follow the following scheme to find the cj:
.
Hence

Using now the algorithm for the consecutive evaluation of convergents, we find the rational approximations:

Note that again these approximations do not represent the original expression for all values of x. For example, the first one has a pole at x = 1/4, the second at x = 2/7, the original has two poles at 1/3 and 1/2. However, away from these poles, the approximations are quite good. For example,

This work displays the need to check on the applicability of the approximations, i.e., their errors and limitations.
The real value of these methods arises with the expansion of power series. We have seen already that we can start from the beginning and cut off whenever we think it is time to do so. Since only the ratios P/Q are of interest, continued fraction expansions may apparently differ.
Find rational approximations for the exponential function:
![]()
Note that the coefficients are powers of 12! We can now obtain the rational functions by expanding the continued fraction.

We can now set x = 1 to obtain for e the rational number 19/7 = 2.714285714286 instead of 2.7182818. If we use the series, we find:
1+1+1/2+1/6+1\24=2.70833333
1+1+1/2+1/6+1\24+1/120=2.716666, etc.
We see that, when it comes to storing the value of e in a computer, it will be much more economical from a storage point of view to store two integers and divide them instead of employing the series. However, as regards ex, we must remember that the zeroes of the denominator of a rational function approximation will impose a restriction on its range of validity. However, we are in the case of the exponential function assisted by the knowledge that we really need only have an accurate approximation for the range 0<x<1, since we can split off from any exponent an integer and multiply the result by the corresponding power of e. I believe that this might be what your calculator does when you use the exponential function. Other functions can be treated in the same manner:
Find the first 5 rational function approximations for::
(1) sin x, (2) tan x,
(3) ln x, (4) cosh x, (5) ln{(1 + x)/(1 - x)),
(6) (1 + x)½, (7) artan x, (8) arsin x,
(9) arcosh x,
evaluate them for x = 0.5 and compare them with the best value the computer or calculator can give you. Compute also the upper bounds of the errors for this value.
Decide between the members of your class which physical constants you will approximate by sufficiently exact rational numbers.