## Friday, May 15, 2009

### The Quadratic Formula

A few weeks ago my eighth-grade daughter learned about the quadratic formula for solving ax2+bx+c=0. She's impressed I can still rattle it off like a song "Negative bee plus or minus the square root of bee squared minus for-ay-see all over two-ay". She then asked the question I love to hear, "How did anyone come up with that formula?" So I decided to show her how to derive it but couldn't figure it out on the spot. How embarrassing! I did manage to figure it out later and showed her the next day.

Her textbook gives conditions to use the quadratic formula.
1. b2-4ac≥0.
2. a≠0.
The first because they haven't learned complex numbers in the eighth grade. How about the second? After all the solution for a=0 is well defined at x=-c/b (assuming b≠0). What happens when you take the limit as a goes to zero? For the square root with sign opposite of b the limit doesn't exist going to plus or minus infinity depending on whether you approach zero from above or below. But for the other square root after applying l'Hôpital's rule and greatly simplifying you do get -c/b. Possibly the most complicated way to solve bx+c=0.

1. You can always use Monte Carlo methods...

2. Teaching how to solve second order equations without giving the proof of the formula is useless! Blindly following 'recipes' has no benefit to students!

3. Did you find out?
It is pretty simple:
(x-x1)*(x-x2)=0
now x1+x2=-b/a x1*x2=c/a
now let x1 = m-n, x2 = m+n (m=(x1+x2)/2)
so x1+x2 = 2m = -b/a
x1*x2=m^2-n^2=c/a
now m = -b/2a
and b^2/4a^2 - c/a = n^2.
So we have n^2 = (b^2-4ac)/4a^2
or n = sqrt(b^2-4ac)/2a and -sqrt(b^2-4ac)/2a
now x1 = m-n, x2 = m+n or
x1 = (-b - sqrt(...))/2a
and x2 = (-b + sqrt(...))/2a.

4. Completing the square:

ax^2 + bx + c = 0
=> x^2 + (b/a)x + (c/a) = 0

(here you need a != 0)

=> x^2 + (b/a)x = -(c/a)

Now we want to make the left hand side a square -- we want to be able to write it in the form (x+y)^2.

But (x+y)^2 = x^2 + 2xy + y^2 , so we go:
2xy = (b/a)x
=> y = (b/2a)

Now we add y^2 to both sides:

x^2 + (b/a)x + (b^2/4a^2) = (b^2/4a^2) -(c/a)
=> (x+ (b/2a))^2 = (b^2 - 4ac)/4a^2

Taking square roots on both sides,

x + (b/2a) = +- \sqrt{(b^2 - 4ac)}/2a

, and so

x = (-b +- \sqrt{(b^2 - 4ac)})/2a

5. Off topic, but related to TCS. There is a posting for stimulus postdocs at the CRA site.

It's great that they have this, but why is the salary so high? Do they realize that many people who got their PhD's 2+ years ago (and are therefore ineligible) still do not have jobs, and yet they are giving extremely high salary (for a postdoc) jobs ($75,000 with$25,000 in "fringe benefits" and \$15,000 per year "discretionary" cost for travel, etc) rather than making more jobs and employing more people.

Makes me wish there had been a financial crisis when I was graduating ..

6. Wolfram alpha shows how to do it if you ask it to "solve ax^2+bx+c=0" (click show steps):
http://www79.wolframalpha.com/input/?i=solve+ax%5E2%2Bbx%2Bc%3D0

7. 1. In reply to anonymous 2
It is not always the case that proofs are essential. What is more useful: Chernoff's formula or knowing how to prove it?

2. If I were to teach the derivation of the quadratic formula for children, I would first teach coordinate changes on the plane, then reduce the equation to the form
x^2 + b/a x + c/a = 0
(emphasizing we must have "a" nonzero),
then solve the simpler family of equations without the linear term, and finally look for a coordinate transformation in which the linear term disappears.

The advantage of this approach is that, although it is slow and complicated, it illustrates a general plan to solve problems by decomposing it into simpler tasks, and, unlike just "completing the square", each task is a useful skill, with more applications.

Of course, using Wolfram may be equally useful.