Investigations in Quadratic Curve Fitting

Investigations in Quadratic Curve Fitting Edward Jules Fuselier, Jr. Department of Mathematics Southeastern Louisiana University Hammond, La. 70401 Fa...
Author: Hector Lindsey
9 downloads 0 Views 115KB Size
Investigations in Quadratic Curve Fitting Edward Jules Fuselier, Jr. Department of Mathematics Southeastern Louisiana University Hammond, La. 70401 Faculty Advisor: Prof. Dennis I. Merino Abstract We study quadratic curve fitting using systems of linear equations. Given three points on the xy-plane, we investigate the possible quadratic equations that fit these points. We explore some geometric properties of these equations, in particular whether they have minimum or maximum values.

1 Introduction One of the most popular real world applications of mathematics is that of curve fitting. Curve fitting involves examining what may seem like a random data set and deriving an equation that strongly describes that set. Functions commonly used for the purpose of curve fitting include exponential and logarithmic functions, but polynomial functions probably hold the most important role. In this paper, we will study quadratic curve fitting using systems of linear equations.

2 Quadratic Curve Fitting Perhaps the most fundamental polynomial is the quadratic function. The graph is in the shape of the letter u and is called a parabola. Definition 1 Let l be a fixed line on the Cartesian plane and let F be a fixed point not on the line. A parabola is the locus of all points P such that the distance from P to F (called the focus) is equal to the distance from P to l (also known as the directrix). This hardly sounds like a description of a quadratic equation, but with simple geometry and algebraic manipulations we can show that it is. When investigating properties of

parabolas, it is convenient to choose a directrix that is parallel to a vertical or a horizontal axis in the xy-plane. This we can do using rotation of axes. We will consider only those parabolas whose directrices are parallel to the x-axis. Let y = d be the directrix, and let (a, b) be the focus F with b ≠ d . Also, let P with coordinates (x , y) be a point on the parabola. Since the distance PD equals the distance PF according to the definition of parabola, we get the following equation:

( y − d )2 = ( x − a) 2 + ( y − b)2 After expanding and then simplifying this expression we find that it is indeed a quadratic equation, y = Ax 2 + Bx + C , where the constants A, B, and C are given by the following: a2 + b2 − d 2 a 1 A= ; B= ; C= . 2(b − d ) d −b 2(b − d ) Also, a, b, and d can be found if given y = Ax 2 + Bx + C : a=

4 AC − B 2 + 1 4 AC − B 2 − 1 −B ; b= ; d = . 4A 4A 2A

It turns out that only three points are needed to find an equation of a parabola. Lemma 1: Given a quadratic equation, the constants A, B, and C can be put in terms of three points that satisfy that equation. Proof: Let y = Ax 2 + Bx + C , with A ≠ 0 , B, and C fixed. Let the points ( x1 , y1 ) , (x 2 , y 2 ) , and (x 3 , y 3 ) satisfy the equation. We now have three equations with three unknowns:

y1 = Ax12 + Bx1 + C y 2 = Ax 22 + Bx 2 + C y 3 = Ax 32 + Bx 3 + C

Using algebra to solve for the constants we get the following equations for each constant: y3 − y 2 y1 − y 2 A= − (x3 − x 2 )(x 3 − x1 ) (x1 − x 2 )(x 3 − x1 ) B=

y1 − y 2 + A(x 22 − x12 ) x1 − x2

C = y1 − Ax12 − Bx1 .

Note that if any two of the three x-coordinates are equal, division by zero will occur. Also, if the points are collinear, the constant A is zero and the function ceases to be quadratic. . Theorem 2: Given three nonlinear points in the xy-plane with distinct xcoordinates, there is a unique quadratic expression that contains all three points. Proof : By the Lemma, the constants A, B, and C can be found in terms of three coordinates on the Cartesian plane. Moreover, we know this is a unique solution from the equivalent conditions for square matrices in linear algebra. These state that if W is an nby-n matrix, then the following conditions are equivalent, see page 14 of [1] or section 6 of chapter 3 of [2]:

a. The determinant of W is not equal to zero. b. Wx = b has a unique solution for every n x 1 matrix b. c. Wx = 0 has only the trivial solution. It follows that if we show a or c, then there is a unique solution to the system. Our three equations in matrix form are: é x12 ê 2 êx2 ê x 32 ë

x1 1ù é Aù é y1 ù ú x 2 1ú êê B úú = êê y 2 x3 1ú êëC ú êë y 3

The matrix W is called a Vandermonde matrix. The determinant of a 3x3

∏ (x 3

Vandermonde matrix is:

i , j =1(i > j )

i

)

− x j = ( x 3 − x 2 )( x 3 − x1 )(x 2 − x1 ) , see page 29 of [1].

Every xi is distinct, so det(W) ≠ 0 . Since the determinant is not equal to zero, then there is a unique solution to the system. It follows that given three non-collinear points having no x-coordinates in common, a unique quadratic equation can be found containing all three points. .

3 Properties of the Parabola The most uncomplicated way to determine which way a parabola opens is to evaluate the sign of the coefficient of the squared variable. Since our generic quadratic equation from earlier is y = Ax 2 + Bx + C , we shall refer to this constant as A. If A is

positive, then the parabola opens upward and has a minimum. If A is negative, the parabola opens downward and has a maximum. Theorem 3: Given three non-collinear points in the xy-plane, the direction of the opening of the parabola that passes through all three points can be determined by the position of the point T (x 2 , y 2 ) with respect to the line l that passes through (x1 , y1 ) and ( x3 , y3 ) , assuming x1 < x2 < x3 . (a) If T is above l, then the parabola opens downward and has a maximum. (b) If T is below l, then the parabola opens upward and has a minimum. Proof: In Lemma 1, we determined that given three points the constant coefficient A is given by the following expression:

A=

y3 − y 2 y1 − y 2 . − (x3 − x 2 )(x 3 − x1 ) (x1 − x 2 )(x 3 − x1 )

This can be rewritten as: A=

( y3 − y 2 )(x2 − x1 ) + ( y1 − y2 )(x3 − x2 ) . (x3 − x1 )(x2 − x1 )(x3 − x2 )

Note that the denominator is positive because x1 < x2 < x3 . Since we are only concerned about the sign of ‘A’, the numerator of the expression is all we will need to determine the direction of the parabola’s opening. Consequently, we can discard the denominator. We will refer to the numerator of this expression as the SDE (Sign Determining Expression). To simplify our problem, we can make the following transformations: s1 = x1 − x1 , t1 = y1 − y1 s2 = x2 − x1 , t2 = y2 − y1 s3 = x3 − x1 , t3 = y3 − y1

( x1 , y1 ) ( x2 , y2 ) ( x3 , y3 )

(0,0) ( s2 , t 2 ) (s3 , t3 ) .

After this translation of axes, the SDE becomes: [(t3 − t2 )s2 − t2 (s3 − s2 )] . Also, the equation of the line that passes through ( x1 , y1 ) and ( x3 , y3 ) in the new coordinate system is simply: f (s ) = ms , where m is the slope, and is given by: m = t3 / s3 . Since all three points are non-collinear, then (s 2 , t 2 ) is either above or below the said line.

Case 1: The point lies below the line f (s ) = ms . In this case, t2 < ms , and can be replaced with t 2 = ms 2 + b , where b is a negative real number. Inserting this into the SDE gives us:

[(t3 − (ms2 + b))s2 − (ms2 + b )(s3 − s2 )] = −b > 0 .

Therefore, the parabola opens upward because the SDE is positive. Case 2: The point lies below the line f (s ) = ms . In this case, t2 > ms , and can be replaced with t 2 = ms 2 + b , where b is a positive real number. Inserting this into the SDE we end up with:

[(t3 − (ms2 + b ))s2 − (ms2 + b )(s3 − s2 )] = −b < 0 . In this case, the parabola opens downward because the SDE is negative. It is interesting to note that when t2 = ms2 , the SDE equals zero. Therefore, ‘A’ is zero and the points are collinear. It follows that given three non-collinear points we can determine which way the parabola that contains them opens. .

4 Polynomial Curve Fitting We have shown that we can find a quadratic equation given three points. We will now show that we can derive a polynomial of degree (n – 1), or less, given n-points. To prove this, we will again employ the equivalent conditions for square matrices. Recall that these say that the following statements are equivalent for an nxn matrix: a.)The determinant of W is not equal to zero. b.)Wx = b has a unique solution for every n x 1 matrix b. c.)Wx = 0 has only the trivial solution. Theorem 3: Given n points in the xy-plane with distinct x-coordinates, there is exactly one polynomial function of degree n-1 or less that passes through all n points. Proof: We prove this by contradiction. Suppose there is not a unique solution to the system. Since one condition fails, then none of the equivalent conditions for square matrices can hold. It follows that Wx = 0 has nonzero solutions. This equation in matrix form is:

é x1n −1 ê n −1 ê x2 ê M ê n −1 ê xn −1 ê x n −1 ë n

x1n − 2 x2n − 2 M n−2 xn −1 xnn − 2

K x1 K x2 O M K xn −1 K xn

1ù é a1 ù é0ù úê ú ê 1ú ê a2 ú ê0 Mú ê M ú = ê M úê ú ê 1ú êan −1 ú ê0 1ú êë an ú êë0

Since at least one ai ≠ 0 and our x-coordinates are distinct, we now have n roots to a polynomial of degree equal to or less than n-1. This contradicts the fundamental

theorem of algebra, which states that a polynomial of degree n has at most n roots. Therefore, Wx = 0 has only the trivial solution and Wx = b has the unique solution x = W −1 b. It follows that given n points with distinct x-coordinates on the xy-plane, there is a polynomial of degree n-1, or less, that fits those points. . We are currently conducting a study on the geometric properties of an (n − 1) st degree polynomial. Our main concern are the limits of f ( x ) as x ∞ and as x −∞ . References:

[1] R. A. Horn and C. R. Johnson. Matrix Analysis Cambridge University Press, Cambridge, MA. 1990. [2] S. J. Leon. Linear Algebra with Applications 5th edition.Prentice Hall, Upper Saddle River, NJ. 1998.