Download Session 2 - Zebragraph

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Large numbers wikipedia , lookup

Vincent's theorem wikipedia , lookup

Addition wikipedia , lookup

Algebra wikipedia , lookup

Recurrence relation wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

Elementary algebra wikipedia , lookup

Elementary mathematics wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Quadratic form wikipedia , lookup

Partial differential equation wikipedia , lookup

History of algebra wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

System of polynomial equations wikipedia , lookup

Transcript
Session 2
Using Iteration to Solve Quadratic Equations
2.1 Roots of a Quadratic Polynomial
Consider a quadratic polynomial p(x) = ax 2 + bx + c, a ¹ 0 . We say a number r is a
zero or root of p( x)  ax 2  bx  c if p(r )  ar 2  br  c  0
Note that testing if a number is a root is easy because we can plug it into the equation and
see that it equals zero. The reverse process is not easy, that is finding a root, or more
precisely approximating a root, e.g approximation of the square-root of two. By solving
a quadratic equation iteratively we mean having a process that can compute a root as
precisely as we wish. In order to approximate the roots of a quadratic polynomial via
iterations it is necessary to find fixed points.
2.2 Newton’s Method for Solving Quadratic Equations
In the 1700’s Sir Isaac Newton devised a way to find solutions to equations of the form
f ( x)  0 . Newton’s Method uses iteration to find solutions to equations such as
quadratic equations and more general polynomial equations. Newton’s Method for
solving equations of the form f (x) = 0 computes orbits of the function
N(x) = x -
f (x)
f '(x)
If f(x) =ax2 + bx + c, the derivative of f (x ) is defined as
f ' ( x)  2ax  b .
Thus, the Newton Function for f(x) is N(x)
N(x) = x -
ax 2 + bx + c 2ax 2 + bx - ax 2 - bx - c ax 2 - c
=
=
2ax + b
2ax + b
2ax + b
Here is how Newton’s Method works. f’(x) is the slope of the tangent line at ( x, f(x) ). If
the initial quess or seed equals x0 then f’(x0) gives the slope of the tangent line at (x0 ,
f(x0) ). The Newton function for f(x), N(x), is equal to
f (x)
N(x) = x f '(x)
Iterating N(x) yields the solutions to f(x) = 0. Here’s why
1. Pick a seed x0 and calculate f(x0 ).
2. The tangent line has equation y - f(x0 ) = f’(x0 )( x - x0 )
3. The x-intercept of the tangent line, x1 , is equal to
x1 = x0 - f (x0 )
f '(x0 )
4. Repeat to find x2
5. Use N(xn) = xn+1 until you get the desired accuracy
Figure 2.5.1 Newton’s Method Diagram
In order to solve x 2  6 x  8  0 , we can form the Newton Function using
a  1, b  6, c  8 . In this case ,
N(x) = x -
x 2 + 6x + 8 x 2 - 8
=
2x + 6
2x + 6
The first column in Table 2.1 shows the orbit of 3. Notice that the orbit very quickly
converges to -2. Also, included in table 1 are the orbits for 2, -5 and -10. Notice that some
orbits tend to one of the solutions and some to the other solution.
3
2
-5
-10
0.083333333
-0.4
-4.25 -6.571428571
-1.296171171 -1.507692308
-4.025 -4.925714286
-1.854628877 -1.918794607 -4.000304878 -4.22250106
-1.990774709 -1.99695048 -4.000000046 -4.02024813
-1.999957836 -1.999995364
-4 -4.000200925
-1.999999999
-2
-4 -4.00000002
-2
-2
-4
-4
-2
-2
-4
-4
2
Table 2.1 Iterative solutions to x  6 x  8  0
Remark. If we take the polynomial f (x) = x 2 - 2 , then Newton’s method gives a
formula for approximation of
2 and it gives:
N ( x) 
x2  2 1 x2 2
1
2
 (  )  ( x  ).
2x
2 x x
2
x
Surprisingly, this coincides with the Babylonian formula!
Exercises 2.2.1
1. In the above example, what is the basin of attraction for the solution x = -2,
x = -4 ?
2. Using Newton’s Method and a spreadsheet to find the solutions and the
corresponding basins of attraction for the following quadratic equations.
You can use the spreadsheet Newton Quadratic Analysis to find the solutions and
and the corresponding Basins of Attraction.
a. 3x2 +10x + 6 = 0
b. 2x2 – 6x +1 = 0
c. x 2  5 x  6  0
d. x 2  2 x  6  0
Class Activity:
Create a color Basin of Attraction Color Plot for the solutions of
x2 – 2x - 8 = 0
2.3 Solving Quadratic Equations and Complex
Numbers
Our goal here is to solve quadratic equations via iterative methods and then enjoy them
through visualization with Polynomiography software. However, first we need to
develop some understanding of complex numbers and why we need to solve equations
iteratively. First we will consider the solutions of a quadratic equation through the
quadratic formula.
In middle and high schools we learn how to solve a linear equation of the form
ax  b  0,
where a is nonzero. The solution is
x
b
a
In an algebra course we learn several different methods for solving quadratic equations
ax 2  bx  c  0
Where a is nonzero. The numbers a, b, c are real numbers, called coefficients. Linear
and quadratic equations are examples of polynomial equations. We can solve linear
equations trivially and some quadratic equations can be solved by factoring. For
example, you could solve x 2  6 x  8  0 by noticing that the sum of the roots is 6 and
their product is 8 so that x 2  6 x  8  ( x  2)( x  4) and then solving ( x  2)( x  4)  0
which has solutions x  2 and x  4 .
You can also solve quadratics by using the quadratic formula which states that the
solutions to the quadratic equation ax 2  bx  c  0 are
x
 b  b 2  4ac
2a
or
x
 b  b 2  4ac
2a
Solving x 2  6 x  8  0 by the quadratic formula you get
x
 6  36  32  6  4  6  2


 2
2
2
2
and
 6  36  32  6  4  6  2


 4
2
2
2
The discriminant of a quadratic polynomial is
x
  b 2  4ac
This can say a lot about the solution of a quadratic equation. If   0 there are two roots.
If   0 there is only one solution and is said to be a repeated root or a double root.
x
b
2a
If   0 there are no solutions. To be exact, there are no real solutions. It turns out that
there are two complex solutions. Later on, SESSION 3, we will consider this case again
after we have formally defined complex numbers.
The quadratic formula gives exact answers in terms of a, b, c , if b 2  4ac is a perfect
square. If for instance the coefficients are integer but the discriminant is not a perfect
square, you have to use a calculator or a set of tables to find approximate values for the
square root of b 2  4ac . Actually what the calculator uses is an iterative method which
goes back to the Babylonians.
2.4
Complex Numbers
We can think of complex numbers as a mechanism to turn a location (a, b) in the
Euclidean plane into a number. This is done by identifying the point with the complex
number
a  ib
where
i  1
so that i  1 . With this rule we can add two complex numbers, subtract them, multiply
and divide them. Examples follow.
2
Example 2.4.1
Consider two complex numbers 1 3i and 2  i . When multiplying or dividing we
have to keep in mind that i 2  1 . Four elementary operations can be defined.
Examples:
(1  3i )  (2  i )  (1  2)  (3  1)i  3  2i
(1  3i )  (2  i )  (1  2)  (3  1)i  1  4i
(1  3i)  (2  i)  2  i  6i  3i 2  2  5i  3  5  5i
Next consider division of the two numbers.
1 + 3i æ 1 + 3i ö æ 2 + i ö
=ç
֍
÷
2 - i è 2 - i ø è 2 + iø
(1 + 3i ) ( 2 + i )
=
(2 - i) (2 + i)
-1 + 7i
5
-1 7
=
+ i
5 5
=
Exercises 2.4.1
1. Let u = 2-3i, v=-3+4i and w= 5-2i. Calculate the following
a. u +v
b. uv
c. 2u+5w
u
w
u v
e. +
v w
3. The conjugate of a + bi is equal to a-bi. Calculate the following
a. (1+2i)(1-2i) and (1+2i)+(1-2i)
b. (3-4i)(3+4i) and (3-4i)+(3+4i)
c. i) What happens when you multiply a complex number and it’s conjugate?
ii) What happens when you add a complex number and it’s conjugate?
d. 4. Find two numbers a and b such that
a. a + b = -6 and a*b = 25
b. a + b =-2 and a*b = 26
5. Food for thought: Given any two real numbers n and m can you always find real
numbers a and b such that a + b = m and ab = n?
2.5
Plotting Complex Numbers
Complex numbers, a + bi, can be plotted in an Argand diagram. The Argand diagram can
also be referred to as the complex plane. In the complex plane the traditional x-axis
represents the real axis and the traditional y-axis represents the imaginary axis. See the
figure below
When you plot the complex number 4+2i in the complex plane as shown in Figure 2.5.1
you go over 4 on the Real axis and up 2 on the Imaginary axis.
Figure 2.5.1 Plot of 4 + 2i
Historical Note: While Argand (1806) is generally credited with the discovery, the
Argand diagram (also known as the Argand plane) was actually described by C. Wessel
prior to Argand. Historically, the geometric representation of a complex number as a
point in the plane was important because it made the whole idea of a complex number
more acceptable. In particular, this visualization helped "imaginary" and "complex"
numbers become accepted in mainstream mathematics as a natural extension to negative
numbers along the real line.
http://mathworld.wolfram.com/ArgandDiagram.html
Exercises 2.5.1
Graph the following complex numbers on the set of axes below.
1. 3 - 2i
2. -3 +5i
3. -1-i
4. 2
5. -3i