LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0Yn restart; Rational approximations and partial fractions
<Text-field style="Heading 1" layout="Heading 1">Introduction</Text-field> In the first lab you saw that real numbers can be approximated by successively more accurate rational numbers. It turns out that something similar can be done to generate rational function approximations to a given function. This process is called Pade approximation. Maple has a built-in function for Pade approximation in the numapprox package. with(numapprox): Here is a rational approximation to the exponential function. It's meant to be accurate for values of x near zero, and the degree of the numerator and the denominator are both required to be at most 1. R11:= pade( exp(x), x=0, [1,1] ); For integration, we saw that rational functions can be written in a standard form known as the partial fraction decomposition. Maple can do this conversion automatically. convert(R11,parfrac,real); From the PFD we see that the approximation becomes infinite at x=2. This obviously limits the domain for which it is a valid approximation. plot( [exp(x),R11], x=-2..1.5, color=[red,blue] ); If we increase the polynomial degrees allowed in the numerator and denominator, we can get a better approximation. For example: R12:= pade( exp(x), x=0, [1,2] ); convert(R12,parfrac,real); What this last PFD tells us is that the denominator cannot be factored into real roots. Since the denominator cannot be zero, the approximation can at least be computed for all values of x, unlike in the [1,1] case. plot( [exp(x),R12], x=-2..2, color=[red,blue] ); By increasing the degrees still more, we can find even better approximations, though we can get infinities. R33:= pade(exp(x), x=0, [3,3] ); convert(R33,parfrac,real); plot( [exp(x),R33], x=-3..3, color=[red,blue] ); Now consider a sequence of approximations to ln(x): L11:= convert(pade( ln(x), x=1, [1,1] ),parfrac,real); L22:= convert(pade( ln(x), x=1, [2,2] ),parfrac,real); L33:= convert(pade( ln(x), x=1, [3,3] ),parfrac,real); L44:= convert(pade( ln(x), x=1, [4,4] ),parfrac,real); L55:= convert(pade( ln(x), x=1, [5,5] ),parfrac,real); The singularities at -0.270, -0.127, -0.0746, -0.0492 are slowly approaching zero, where the true function ln(x) has a singularity (asymptote). In fact, the possibility of zero denominators is a feature, not a bug. The ability to imitate a singularity gives rational approximations a lot more power than polynomial approximations. We get a polynomial from pade if we require that the degree of the denominator be zero. (Later in the course we will see how this polynomial is found.) L60:= pade( ln(x), x=1, [6,0] ); expand(L60); plot( [ln(x),L33,L60], x=0.01..2.5, color=[red,blue,black] ); If you look carefully at the graph, you see that the red curve (ln(x)) is much better approximated by the blue curve (the [3,3] approximation) than by the black curve (the [6,0] polynomial approximation).
<Text-field style="Heading 1" layout="Heading 1">Exercises</Text-field> 1. Consider the Pade approximants to tan(sin(x)) at x=0 of type [k,k], where k=1,2,3,4,5. Show that none of them have any real singularites (in other words, they are have well defined finite values for all real x). 2. Now do the same for tan(4 sin(x)), and show that for k>1, they all have real singularities. Also make a table showing the location of the positive singularity closest to zero: LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEia0YnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJw== LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEsc2luZ3VsYXJpdHlGJy8lJ2l0YWxpY0dRJXRydWVGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRic= LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbW5HRiQ2JFEiMUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJw== LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYlLUkjbW9HRiQ2MFEqJnVtaW51czA7RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR0Y0LyUpc3RyZXRjaHlHRjQvJSpzeW1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d0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbW5HRiQ2JFEiNUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJw== LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSZmYWxzZUYnLyUsbWF0aHZhcmlhbnRHUSdub3JtYWxGJw==
These values should appear to be converging to about 0.4036. Where does this number come from, in terms of the original tan(4 sin(x))? Why was this case fundamentally different from part 1 above?
LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2JVEhRicvJSdpdGFsaWNHUSV0cnVlRicvJSxtYXRodmFyaWFudEdRJ2l0YWxpY0Yn