Investigation of Tangent Polynomials wit a Computer Algebra System Te AMATYC Review, Vol. 14, No. 1, Fall 199, pp. -7. Jon H. Matews California State University Fullerton Fullerton, CA 9834 By Russell W. Howell Westmont College Santa Barbara, CA 9318 Computer algebra systems (CAS's) suc as Derive, Maple and Matematica are influencing te way we teac matematics. Wit te assistance of CAS, we can examine new avenues for exploring old problems, and peraps gain new insigts. For tis paper, we take a close look at te fact tat te limit of te secant line is te tangent line. We recast tis situation in te notation of polynomial approximation and view te secant line as te Newton polynomial P 1 (x) of degree one passing troug te two points (x, f(x )) and (x +, f(x +)). Te tangent line is te Taylor polynomial T 1 (x) ) + f '(x )(x-x ). It is well known tat T 1 (x) is te limit of P 1 (x) as ->. Figure 1 sows f(x) = e x/4 cos(x) and te linear approximations T 1 (x) and P 1 (x) based on x = and = 1 4. Figure 1. Grap of f(x), P 1 (x), and T 1 (x) (dased line). It is sown ow te Newton polynomial P n (x) is derived on a given interval. Te computer algebra system Matematica is used to assist wit te construction of P n (x) and to demonstrate tat te limit of a certain sequence {P n (x)} of Newton polynomials is te Taylor polynomial T n (x) of degree n. Hence, te Taylor polynomial is visualized as te limit of approximating polynomials and is imagined to be te tangent polynomial on te given interval.
Preliminary Results Isaac Newton developed and refined metods for fitting polynomials to curves in te second alf of te fifteent century [Witeside, 1976, Vol. IV, pp. 14-73; Vol VIII, pp. 36-57]. In te early 169's e used tese metods to calculate te apparent pat of a coment from individual sigtings of its orbit [Witeside, 1976, Vol. VII, p. 67]. Today Newton polynomials are a familiar topic in numerical analysis [cf. Matews, 1987, p. 186], and take te following form: Te Newton polynomial of degree n=1 is P 1 (x) = + a 1 (x - x ). (1) Te coefficients in equation (1) are determined by forcing P 1 (x) to pass troug te two points (x, f(x )) and (x +, f(x + )). Tis leads to te linear system: + a 1 (x - x ) ) + a 1 (x +-x ) + ), () f(x + ) - f(x ) te solution of wic is ) and a 1 =. Hence, te polynomial P 1 (x) can be expressed in te form: P 1 (x) ) + f(x + ) - f(x ) (x - x ). (3) Assuming tat f(x) is differentiable, and letting approac in equation (3), we find tat te limit of te Newton polynomial P 1 (x) is te Taylor polynomial T 1 (x), i.e. f ( x + ) f ( x ) lim P 1 (x) ) + lim ( x x) ) + f '(x ) (x - x ) = T 1 (x). (4) A similar penomenon occurs for quadratic polynomials. We begin wit te Newton polynomial P (x) = + a 1 (x - x ) + a (x - x )(x - x 1 ). (5) Te coefficients in equation (5) are determined by forcing P (x) to pass troug te tree points (x k, f(x k )) for x k = x + k and k=,1,. Tis leads to te lower-triangular linear system ) + a 1 + ), + a 1 + a + ). (6) Tis system can easily be solved by forward substitution to obtain:
f(x + ) - f(x ) ), a 1 = on te form: f(x ) - f( + x ) + f(x + ) and a =!. Tus te polynomial P (x) takes f(x +) - f(x ) f(x ) - f(+x ) + f(x +) P (x) ) + (x - x ) +! (x - x ) (x - x 1 ). (7) Using te notation = x, te coefficient a can be viewed as one alf of te second order Newton difference quotient f x. It is well known tat f x is te forward difference approximation for f ''(x ), and tends to tis quantity as ->. Tus, we can conclude from equation (7) tat te limit of te Newton polynomial P (x) as -> is te Taylor polynomial T (x): f ( x + ) f ( x) lim P (x) ) + lim ( x x ) f ( x ) f ( + x) + f ( x + ) + lim ( x x)( x x )! ) + f '(x ) (x - x ) + f ''(x ) (x - x! ) = T (x). (8) Te software Matematica can solve systems, differentiate and find limits. Additionally, it can symbolically manipulate quantities involving an arbitrary function f(x). Te dialogue for establising (4) starts by defining te function P1[x] in equation (3): P1[x_,x_,_] = f[x] + (f[x+]-f[x])(x-x)/ f[x] + (x - x) (-f[x] + f[ + x]) We ten invoke Matematica s Limit procedure and let ->. As anticipated, te result is te Taylor polynomial of degree n=1: T1[x_] = Limit[P1[x,x,],->,Analytic->True] f[x] + (x - x) f'[x] CAS Investigation of Polynomials of Higer Degree A natural question to ask now is: Wat about polynomial approximation of iger degrees? Exploration of te Newton polynomials involves complicated symbolic manipulations and is prone to error wen carried out wit and computations. Tese derivations can become instructive and enjoyable wen tey are performed wit computer algebra software. Let P 3 (x) be te Newton polynomial tat passes troug te four points (x k, f(x k )) for x k = x + k and k=,..,4. It may be sown tat te Taylor polynomial T 3 (x) is te limit of P 3 (x). 3
We sall use te power of Matematica to assist us wit tis derivation. Begin by setting y(x) equal to te general form of a Newton polynomial by issuing te following Matematica commands: n = 3; Vars = Table[a[k],{k,,n}]; Eqns = Table[,{4}]; y[x_] = Sum[a[j] Product[x-x- i,{i,,j-1}],{j,,n}] Te output generated by te computer is: a[] + (x - x) a[1] + (x - x) (- + x - x) a[] + (x - x) (- + x - x) (- + x - x) a[3] points: Now form te set of four equations tat force te polynomial to pass troug te four equally-spaced n = 3; Do[Eqns[[k+1]]=y[x+k*]==f[x+k*],{k,,n}]; TableForm[Eqns] a[] == f[x] a[] + a[1] == f[ + x] a[] + a[1] + a[] == f[ + x] 3 a[] + 3 a[1] + 6 a[] + 6 a[3] == f[3 + x] Ten solve tis linear system, and construct te polynomial P 3 (x), and stored it as te function P[x,x,] (since it involves te additional parameters x and ). Solutions = Solve[Eqns,Vars]; Solutions = First[MapAll[Togeter,Solutions]]; Y = y[x]/.solutions; P[x_,x_,_] = Y f[x] + (x - x) (-f[x] + f[ + x]) + (x - x) (- + x - x) (f[x] - f[ + x] + f[ + x]) + (x-x)(-+x-x)(-+x-x)(-f[x] + 3f[+x] - 3f[+x] + f[3+x]) 6 3 Finally, compute te limit to verify tat our conjecture was correct: 4
T[x_] = Limit[P[x,x,],->,Analytic->True] f[x] + (x-x) f'[x] + (x-x) f''[x] + (x-x) 3 f (3) [x] 6 Eureka! Te limiting case of P 3 (x) as -> is te Taylor polynomial T 3 (x). Observe tat te option Analytic->True must be used in Matematica's limit procedure. Tis is a matematicians way to tell te computer tat f(x) is "sufficiently differentiable." An Example It is instructive to visually see ow te Newton polynomials converge to te Taylor polynomial. For illustration we use te function f(x) = e x/4 cos(x) and te point x = and draw te graps of Newton polynomials wit = 1 4 and = 1 16 and compare tem wit te Taylor polynomial. First, enter f into te session by typing f[x_] = Exp[x/4]Cos[x]. Ten use te built in Matematica command Series to generate te Taylor polynomial for f(x) centered at x = of degree 3: T[x_] = Normal[Series[f[x],{x,,3}]] 1 + x 4-15 x 3-47 x 3 384 Figure sows a comparison of te Taylor polynomial T 3 (x) and f(x): gr[] = Plot[T[x],{x,-4.7,3.5},PlotRange->{-3.,1.}, PlotStyle->Dasing[{.,.}], Ticks->{Range[-4,3,1],Range[-3,3,1]}]; grf = Plot[f[x],{x,-4.7,3.5},PlotRange->{-3.,1.}, PlotStyle->Tickness[.6], Ticks->{Range[-4,3,1],Range[-3,3,1]}]; Sow[grf,gr[]]; Figure. f(x) and T 3 (x) (te dased curve). 5
Figure 3 compares P 3 (x,,1/4), te Newton polynomial wit x = and = 1 4, and te four equallyspaced points on wic it is based. Tis grap was obtained by issuing te subroutine call grap[1/4]. Te syntax for te subroutine grap[] is listed in te appendix. Figure 3. P 3 (x,,1) and f(x) (te "tick" curve) We can easily obtain a comparison of f(x) and P 3 (x) for smaller and smaller values of. Use te command grap[1/16] to construct P 3 (x) for = 1 16 and store it in gr[1/16]. Ten te following command will grap te Newton polynomials for = 1 4 and = 1 16 its Taylor polynomial T 3 (x) :, along wit te original function f(x) and Sow[{grf,gr[],gr[1/16],gr[1/4]}]; Figure 4. f(x) (te "tick" curve), P 3 (x,,1/4), P 3 (x,,1/16) (closest to te dased curve) and T 3 (x) (dased) Te General Case Te command to form an arbitrary Newton polynomial is: Sum[a[j] Product[x-x- i,{i,,j-1}],{j,,n}] 6
and was used in te above derivations. Proceeding to an arbitrary case is accomplised by merely canging te value of n to some value oter tan n=3. Experimentation as revealed tat Matematica can quickly solve te general case for degrees up to n=9. Concluding Remarks We ave sown ow a CAS suc as Matematica can be used in a meaningful way to make matematical exploration enjoyable, even wen computations become laborious. One sould note tat te CAS is limited in tat it is unable to solve our problem for a general case (n arbitrary), but rater requires specific values of n. Te interested reader is encouraged to formulate a proof for suc a general case. Appendix Te following is te listing of te subroutine for plotting te Newton polynomial, te points wic it is to pass troug, and te Taylor polynomial. Te programming language is Matematica. grap[_] := Block[{}, xys = Table[{(k-1),f[(k-1)]},{k,4}]; dots = ListPlot[xys,PlotStyle->{PointSize[.]}]; grf = Plot[f[x],{x,-4.7,3.5}, PlotRange->{-3.,1.}, Ticks->{Range[-4,3,1],Range[-3,1,1]}]; gr[] = Plot[P[x,,],{x,-4.7,3.5}, PlotRange->{-3.,1.}, PlotStyle->Tickness[.], Ticks->{Range[-4,3,1],Range[-3,1,1]}]; Sow[{grf,gr[],dots}]; ] References Matews, J. H., 1987, Numerical Metods. Englewood Cliffs, N.J.: Prentice-Hall. Witeside, D. T. (Ed.), 1976, Te Matematical Papers of Isaac Newton, New York, N..Y.: Cambridge University Press 7
Numerical Metods Using Matlab, 4 t Edition, 4 Jon H. Matews and Kurtis K. Fink ISBN: -13-6548- Prentice-Hall Inc. Upper Saddle River, New Jersey, USA ttp://vig.prenall.com/