Quadratic equations

Hi all, I’m trying to learn how to solve quadratic equations but I’ve ran into a problem.
On the wikipedia page: http://en.wikipedia.org/wiki/Quadratic_equation
It explains the step by step process of solving a quadratic equation using the “Complete the square” method. The fourth step states: “Write the left side as a square, and simplify the right side, if necessary.”
And this appears to change the expression “x² + 2x + 1” into “(x + 1)²” and I’m not exactly sure how that’s come about. Could somebody explain it to me?

Thanks!

Paul

If its for a program, just use the quadratic equation that solves it all:

x1,x2 = (-b (+/-) sqrt(b^2-4ac)) /2a

you have to do it twice, one for the + and another for the -

Basically,you multiply (x+1) by (x+1). So you go
First, (x+1)(x+1), which is xx, or x^2
Outside, (x+1)(x+1), which is x
1, or simply x
Inside, (x+1)(x+1), which is 1x, or simply x
Last, (x+1)(x+1), which is 1
1, or 1
Then you put it together and it becomes x^2 + x + x + 1, which is then simplified to x^2 + 2x + 1. This process is called FOIL.

Thanks for the replies guys! So Geemili, is what I described just FOIL in reverse?

Oh, I didn’t read your post closely enough. I don’t know the process of getting from “x² + 2x + 1”, how I remember solving it in math class is by plugging in random numbers into (ax + b)(cx + d), until it would form the quadratic equation through FOIL. I’m sure there’s a better way, I just don’t know it. :stuck_out_tongue:

Yeah, I keep re-reading this instructions thinking I’m missing a subtle wording, but that step completely throws me. The other steps are fairly trivial.

Holy crap you don’t know Algebra (yet hopefully?)…how old are you Porlus?!

Old enough for it to be embarrassing. ): I’m alright with other areas of algebra. This has just stumped me.

I’ll second what Agro said about the quadratic formula. It’s really easy, you just plug in the numbers and out comes the answer.
(-b±√(b²-4ac)) / (2a)
As far as I remember you use this with a trinomial or something like that… I haven’t used it in a while. =P

Thanks for the reply. :slight_smile: Yeah, all I remember from secondary school with regards to quadratic equations was that formula. I’m just trying to look at the other methods of solving it to help me get a better understanding. Completing the square is the method that I recall the teacher saying takes too long to work out in an exam. Hurray for the British education system. D: So now I’m trying to learn it on my own and struggling a bit.

The “plug in numbers” method is bullshit, but all the schools teach it. I don’t think that’s his question though…
“x² + 2x + 1”
To be able to simplify, your equation needs to be in the form a^2 + 2ab + b^2 which it already is. Now “a^2 + 2ab + b^2” simplifies into “(a+b)^2”, so looking at your equation, the root of x² is x and the root of 1 is 1. Thus you have (x+1)^2.

I dot know what your talking about. The quadradic formula is great for getting values of x that aren’t whole for polynomials with degrees of two. It doesn’t help in factoring at all, but if you already have x, why factor?

He’s asking someone to explain why “x² + 2x + 1” can be factored into “(x + 1)²” and how. He never asked anything about finding what x was, or how to use it in a program.

Solving Quadratic Equations (by brain):

You have to make one side equal zero. Because if one side is zero, one (or both) of the factors has to be zero. Then you find the 2 (or sometimes 1) value(s) of x, and you take the one you want.

1. If the equation is in the form (ax + b)^2 = 0

This means that ax + b = 0
-> ax = -b
-> x = (-b)/a

2. If the equation is in the form (ax + b)(cx + d) = 0

This means that either ax + b = 0 or cx + d = 0
First, assume ax1 + b = 0 (x1 and x2 are the possible values of x)
-> x1 = (-b)/a
and then cx2 + d = 0
-> x2 = (-d)/c

So now you have x1 and x2. But you only want one. This is where it comes down to common sense. (eg: can’t have negative amounts of people etc.) Look back to the situation.

3. If the equation is in the form ax^2 + bx + c = 0

You need to get this into factorised form.

Find two numbers (d and e) that match the following equations:
de = ac (and therefore: d/a = e/c, which is important later)
d+e = b

Now you can rearrange the formula to this:
ax^2 + dx + ex + c = 0

Factorise the first two terms, and the last two terms seperately:
ax^2 + dx = ax(x + d/a)
ex + c = e(x + c/e)

And because d/a = c/e (as shown above), we’ll make it easier by having f = d/a = c/e.
The new equations:
ax(x + f)
e(x + f)

And now to add them together again:
ax(x + f) + e(x + f) = 0
(ax + e)(x + f) = 0

Now continue with method #2 above.

4. For other equations

Rearrange into ax^2 + bx + c = 0, then use method #3.

Note: For programming purposes, use the quadratic formula.

It doesn’t take that long, and it’s the way that the formula you memorise was derived.

If you’re needing to solve quadratic equations for a game, be aware that there are numerical issues with one half of -b +/- sqrt(b^2 - 4ac) when 4ac is small. The way to handle this is to have a case split on the sign of b and then to use the fact that the product of the roots is c/a.

Completing the square is way easier if the variable a in the quadratic equation does not have coefficients, e.g. x2 + 3x + 2. Then it’s by far way simpler than having to write out the whole quadratic formula and solve it. But if you have a coefficient for the variable a, it takes way too long.

Ah, I understand now. I guess just the way you worded it made me think differently.

Not necessarily true. The multiples of the coefficient of “a” you can plugin on the left of a matrix - and the multiples of “c” you can plug in on the right. For example: 5x2 + 12x + 4

5|2

1|2

Cross multiply and add 52 + 21 = 12. Which means this is the solution, because it equals the coefficient of x (middle term) - to convert into 2 binomials just do (5x + 2)(x + 2). Obviously, you still have to plug in some numbers, but this way is a lot faster.