* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Solving simple equations, a review/primer
History of mathematical notation wikipedia , lookup
Line (geometry) wikipedia , lookup
List of important publications in mathematics wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
Analytical mechanics wikipedia , lookup
Recurrence relation wikipedia , lookup
Elementary algebra wikipedia , lookup
History of algebra wikipedia , lookup
System of polynomial equations wikipedia , lookup
UCSC AMS/ECON 11A Supplemental Notes # 2 Solving simple equations, a review/primer c 2007 Yonatan Katznelson Differential calculus does not replace algebra, it builds on it. When working problems in calculus, you will find yourself faced with the usual algebraic tasks of simplifying some expressions, expanding others, and of course, solving equations. There is no unified set of formulas for solving general algebraic equations1. On the other hand there are simple methods and formulas for the equations that you will encounter most frequently: linear and quadratic equations, or systems of these equations. 1. Equations in one variable A solution of an equation in one variable is a number that satisfies the equation. In general, equations can have no solutions, one solution, two solutions or more. In this course we will only be considering real numbers, and so when we speak of ‘the solution(s)’ of an equation we will only be considering real solutions. Many equations have solutions that are not real numbers, e.g., the equation x2 − 2x + 2 = 0 √ √ has two solutions given √ by x1 = 1 − −1 and x2 = 1 + −1. These are complex numbers because they involve −1, which is a perfectly good number, except that it is not a real number. If we consider only real values of the variable x then (1) x2 − 2x + 2 = (x − 1)2 + 1 ≥ 1 for any real x, since the square of the real number is always nonnegative. This implies that equation (1) has no real solutions. 1.1 Linear equations The simplest equation that you will encounter is a linear equation in one variable, e.g., ax + b = c, where x is the variable and a, b and c are constants. If a 6= 0, then the solution is given by c−b x= . a If a = 0, then there is no variable, and the equation either reduces to a tautology or to a contradiction, depending on whether b = c or b 6= c, respectively. 1.2 Quadratic equations A quadratic equation in one variable can always be rearranged to look like this (2) 1 ax2 + bx + c = 0, There are formulas for solving polynomial equations of the form an xn + an−1 xn−1 + · · · + a1 x + a0 = 0 when n ≤ 4, it was proved in the 19th century that this cannot be done in general when n ≥ 5. This doesn’t mean that there are no solutions, just that there is no uniform method for finding them. 1 2 where, as usual, we assume that a, b and c are real numbers. The solutions, if they exist, can be found by completing the square b b2 b2 b 2 4ac − b2 2 2 ax + bx + c = a x + x + 2 − +c=a x+ + . a 4a 4a 2a 4a Plug the right hand side above into equation (2) b 2 4ac − b2 = 0, + a x+ 2a 4a and move things around to get b 2 b2 − 4ac x+ = . 2a 4a2 Now, take square roots on both sides and move things around again to obtain the quadratic formula for the solutions √ √ −b + b2 − 4a −b − b2 − 4a and x2 = . (3) x1 = 2a 2a The expression b2 − 4ac is called the discriminant, and there are three possibilities, depending on whether the discriminant is positive, zero or negative. • If b2 − 4ac > 0, then the two solutions given by (3) are different from each other, so equation (2) has two different real solutions. • If b2 − 4ac = 0, then the two solutions given by (3) are the same, and equation (2) has one real solution. • If b2 − 4ac < 0, then there are no real solutions, and the two solutions given by the quadratic formula are complex numbers. 1.3 Factoring Many polynomial equations, ak xk + ak−1 xk−1 + · · · + a2 x2 + a1 x + a0 = 0, can be simplified or even completely solved by factoring the polynomial on the left into its simplest factors. Then we use a very basic and very important property of real (and complex) numbers. Fact 1. If A1 , A2 , . . . , An are real numbers and A1 · A2 · · · An = 0 then A1 = 0 or A2 = 0 or . . . or An = 0. In words, if the product of n real numbers is 0 then at least one of the numbers must be 0. Example 1. Solve the equation x3 − x2 − 4x + 4 = 0. This is a cubic equation, so the quadratic formula doesn’t apply. To solve this we factor the polynomial into linear factors: x3 − x2 − 4x + 4 = (x − 1)(x − 2)(x + 2). The original equation may now be written as (4) (x − 1)(x − 2)(x + 2) = 0. 3 In view of Fact 1, it follows that x−1=0 or x−2=0 or x + 2 = 0, so the solutions of equation (4), and hence of the original equation, are x1 = 1, x2 = 2 and x3 = −2. Example 2. Solve the equation x4 − 1 = 0. The quartic polynomial on the left factors as follows x4 − 1 = (x2 − 1)(x2 + 1) = (x − 1)(x + 1)(x2 + 1), so the quartic equation above is equivalent to (x − 1)(x + 1)(x2 + 1) = 0. There are only two real solutions in this case, x1 = 1 and x2 = −1, since the third factor, x2 + 1, cannot be 0 if x is real. Comment: Polynomials can sometimes be factored easily by trial and error. However, factoring ak xk + ak−1 xk−1 + · · · + a2 x2 + a1 x + a0 is actually equivalent to solving the equation ak xk + ak−1 xk−1 + · · · + a2 x2 + a1 x + a0 = 0, and is generally a hard problem. In practice, people who need to solve complicated polynomial equations often resort to approximation techniques, (e.g., Newton’s method, see section 12.6 in the book), or computer programs to find (approximate) solutions. 2. Systems of equations A system of equations is a collection of two or more equations, typically involving two or more variables. Generically, we can represent a system of equations like this F1 (x1 , x2 , . . . , xk ) = d1 F2 (x1 , x2 , . . . , xk ) = d2 .. . Fm (x1 , x2 , . . . , xk ) = dm , where F1 through Fm are m algebraic expressions, d1 through dm are m constants, and x1 through xk are the variables. A solution of such a system is a k-tuple of numbers, (x?1 , x?2 , . . . , x?k ), that satisfy all of the m equations simultaneously. For example (5) x2 + 2xy − 2y 2 = 1 x + 3y = 2 is a system of two equations in two variables, and 2x + 3y + z = 1 (6) x − 2y − 3z = 2 x + y + 2z = 3 is a system of three equations in three variables. 4 There is no rule saying that the number of equations must equal the number of variables, but this is the case that we will encounter most frequently (perhaps exclusively) in this course. 2.1 Successive substitution and reduction The most elementary approach to solving a system of equations is to successively solve each equation for one of the variables in terms of the remaining variables, and then substitute the expression you find in the remaining equations. In this way you successively reduce the number of equations and the number of variables, until you reach a system that is (we hope) easy to solve. This is an ad hoc method, with no fixed set of rules. This is both a strength and a weakness. A strength, because the method works in principal for any system of equations. A weakness, because there is no fixed set of criteria that you can apply to determine whether or not you are on the right track before you reach the end. I’ll illustrate the method with two simple examples. Example 3. Consider the system (5) above. We can solve the second equation for x: x = 2 − 3y and substitute this into the first equation to obtain x2 + 2xy − 2y 2 = (2 − 3y)2 + 2(2 − 3y)y − 2y 2 = 1, which simplifies to y 2 − 12y + 7 = 0. This quadratic equation in y has two real solutions √ √ √ √ 12 − 144 − 28 12 + 144 − 28 y1 = = 6 − 29 ≈ 0.615 and y2 = = 6 + 29 ≈ 11.385. 2 2 Corresponding to each y value there is an x value x1 = 2 − 3y1 ≈ 0.155 and x2 = 2 − 3y2 ≈ −32.155, so the two solutions of the system are (0.155, 0.615) and (−32.155, 11.385). Example 4. We can solve the system (6) in the same way. Solving the first equation for z gives z = 1 − 2x − 3y. Substitute this into both of the remaining equations reduces the original system of equations to a system of two equations in two variables, x − 2y − 3z = x − 2y − 3(1 − 2x − 3y) = 2 x + y + 2z = x + y + 2(1 − 2x − 3y) = 3, which simplifies to (7) 7x + 7y = 5 (8) −3x − 5y = 1. Next, solve (7) for y y= 5 − x, 7 and substitute this into (8) −3x − 5 5 −x 7 = 2x − 25 = 1, 7 5 giving 16 , 7 5 16 11 32 33 8 − =− and z = 1 − + = . 7 7 7 7 7 7 16 11 8 . In this case there is exactly one solution ,− , 7 7 7 x= y= Comment: When you use this method you can start with any of the equations and solve for any of the variables. Some choices may make your work easier and others may make your work more difficult. The more you practice, the more obvious the ‘good’ choices will be. 3. Systems of linear equations If all of the equations in a system are linear in the variables, then there is a simple, structured approach to finding the solutions. A system of linear equations looks like a11 x1 + a12 x2 + · · · + a1k xk a21 x1 + a22 x2 + · · · + a2k xk = = .. . b1 b2 am1 x1 + am2 x2 + · · · + amk xk = bm Many mathematical problems can be reduced to solving systems of linear equations. The field that studies this problem in general, among others, is called linear algebra.2 In Example 3 there were two equations in two variables, and we found precisely two solutions. But in that example one of the equations was not linear. When all of the equations in a system of equations are linear, then there are exactly three possibilities. a. Exactly one solution. b. No solutions. c. Infinitely many solutions. Furthermore, exactly one solution is only possible if the number of equations is equal to (or greater than) the number of variables. When it comes to finding the solution(s) of a system of linear equations, you can always use the method of successive substitution and reduction. It is easy, but can become tedious when the number of equations/variables is large. In general however, there is a better method, called Gaussian. I will illustrate this method in some simple examples, below. Example 5. Let’s find the solution(s), if they exist, of the pair of equations 3x + 4y = 5 5x + 6y = 7. To eliminate the variable y, we multiply the first equation by 6, multiply the second equation by −4, then add the modified equations together, and collect terms to obtain a very simple equation: 6(3x + 4y = 5) + (−4)(5x + 6y = 7) −2x + 0 · y = 2. 2 If you have plans to pursue graduate studies in economics, or you simply want a better grasp of the material at the undergraduate level, then you should definitely take at least one course in linear algebra, (e.g., Math 21 at UCSC). 6 2 In other words, we find that x = −2 = −1. Likewise, to eliminate x we multiply the first equation by −5, multiply the second equation by 3, and add the modified equations together, to obtain (−5)(3x + 4y = 5) + 3(5x + 6y = 7) 0 · x − 2y = −4, so y = −4 −2 = 2. Thus, the unique solution to this pair of equations is (x, y) = (−1, 2). The steps that we performed to eliminate each of the variables in the pair of equations above, can be repeated for any pair of equations in two variables. The key step, of then solving for the remaining variable, and so producing a unique solution, is not always possible. Fact 2. If ad − bc 6= 0, then the pair of equations (9) ax + by = α cx + dy = β has a unique solution (x0 , y0 ) given by the formulas (10) x0 = αd − bβ . ad − bc y0 = aβ − αc . ad − bc and (11) Proof: As in the example above, I’ll add multiples of the equations together to eliminate each of the variables in turn. To eliminate y, multiply the first equation by d, multiply the second equation by −b, and add the results together to obtain (12) d(ax + by = α) + (−b)(cx + dy = β) (ad − bc) · x + 0 · y = αd − bβ. Now, because of the assumption ad − bc 6= 0, we may divide both sides of the last equation by ad − bc, to obtain equation (10), above. Likewise, to eliminate x from the pair of equations, we multiply the first equation by −c, multiply the second equation by a, and add the modified equations to obtain (−c)(ax + by = α) + a(cx + dy = β) , 0 · x + (ad − bc) · y = aβ − cα, from which equation (11) follows in the same way. Moreover, (x0 , y0 ) is the only possible solution in this case, (why?). Comments: 1. The formulas (10) and (11) are particular cases of what is often called Cramer’s rule. 2. Fact 2 generalizes to systems of n linear equations in n variables, as does Cramer’s rule. The formulas in Cramer’s rule quickly become complicated as the number of variables/equations increases, e.g., for three equations in three variables we have Fact 3. If a(ei − f h) + b(f g − di) + c(dh − eg) 6= 0, then the system of equations (13) ax + by + cz = α dx + ey + f z = β gx + hy + iz = γ 7 has a unique solution given by (14) x0 = α(ei − f h) + β(ch − bi) + γ(bf − ce) a(ei − f h) + b(f g − di) + c(dh − eg) y0 = α(f g − di) + β(ai − cg) + γ(cd − af ) a(ei − f h) + b(f g − di) + c(dh − eg) z0 α(dh − eg) + β(bg − ah) + γ(ae − bd) . a(ei − f h) + b(f g − di) + c(dh − eg) = The proof of this fact follows along the same lines as the proof of Fact 2, i.e., variables are eliminated by adding multiples of the equations together. 3. If the assumption ad − bc 6= 0 in Fact 2 is false, i.e., if ad − bc = 0, then the pair of equations (9) may have either no solutions or infinitely many solutions. Likewise, if the condition a(ei − f h) + b(f g − di) + c(dh − eg) 6= 0 in Fact 3 fails, then the system (13) may have no solutions or infinitely many. The expressions ad − bc in the case of two equations, and a(ei − f h) + b(f g − di) + c(dh − eg) in the case of three equations, are called the determinants of their respective systems, (perhaps since they determine whether the system has a unique solution or not). 4. Finally, I don’t recommend trying to memorize the formulas in Cramer’s rule. Rather practice using the method, (Gaussian elimination), which leads to these formulas. Example 6. I’ll use Cramer’s rule to solve the system of three linear equations in Example 4. For that system we have a=2 b=3 c=1 d = 1 e = −2 f = −3 g=1 h=1 i=2 and α = 1, β = 2 and γ = 3. To use Cramer’s rule, we first check that the determinant of the system is not 0, 2(−4 + 3) + 3(−3 − 2) + 1(1 + 2) = −2 − 15 + 3 = −14 6= 0. Now we can proceed and use the formulas in (14) to obtain the unique solution −32 16 22 11 −16 8 x0 = = , y0 = =− and z0 = = , −14 7 −14 7 −14 7 which is the same solution we found before. Example 7. Sometimes systems of equations that are not linear can be transformed into linear systems by renaming the variables. For instance, to solve the system 7x2 + 2y 2 = 71 3x2 + 5y 2 = 47, we first set u = x2 and v = y 2 to obtain the linear system for u and v 7u + 2v = 71 3u + 5v = 47. 8 The determinant of this pair of equations is 7 · 5 − 2 · 3 = 29 6= 0, so we can use Cramer’s rule to obtain the solution 71 · 5 − 2 · 47 7 · 47 − 71 · 3 u= = 9 and v = = 4. 29 29 Since x2 = u and y 2 = v, this means that x = ±3 and y = ±2, so the original system has the four solutions (3, 2), (3, −2), (−3, 2) and (−3, −2). To understand why a pair of linear equations has exactly one solution,3 while a pair of nonlinear equations, as in the previous example, can have exactly four solutions,4 it is instructive to consider the graphs of the equations involved. The graph of a linear equation in two variables is a straight line (hence the name), while the graphs of the equations in the last example are ellipses. If two straight lines intersect, then they intersect in exactly one point. If a pair of ellipses intersect, then they may intersect in one, two or four points. See the figures below. 10 5 -20 -15 -10 -5 0 5 10 15 20 -5 -10 Figure 1. The graphs of 7x + 2y = 71 (orange) and 3x + 5y = 47 (blue). 5 2.5 -10 -7.5 -5 -2.5 0 2.5 5 7.5 10 -2.5 -5 Figure 2. The graphs of 7x2 + 2y 2 = 71 (orange) and 3x2 + 5y 2 = 47 (blue). 3 Unless it has no solutions, or infinitely many. 4 Or some other finite number of solutions.