Porlus


«
Posted
20130613 01:39:40 » 

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_equationIt 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




Agro


«
Reply #1  Posted
20130613 01:46:24 » 

If its for a program, just use the quadratic equation that solves it all:
x1,x2 = (b (+/) sqrt(b^24ac)) /2a
you have to do it twice, one for the + and another for the 




Geemili


«
Reply #2  Posted
20130613 01:48:52 » 

Basically,you multiply (x+1) by (x+1). So you go First, (x+1)(x+1), which is x*x, or x^2 Outside, (x+1)(x+1), which is x*1, or simply x Inside, (x+1)(x+1), which is 1*x, 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.




Games published by our own members! Check 'em out!


Porlus


«
Reply #3  Posted
20130613 01:55:04 » 

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




Geemili


«
Reply #4  Posted
20130613 02:12:05 » 

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.




Porlus


«
Reply #5  Posted
20130613 02:18:55 » 

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




ra4king


«
Reply #6  Posted
20130613 03:08:26 » 

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




Porlus


«
Reply #7  Posted
20130613 03:18:43 » 

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




tyeeeee1


«
Reply #8  Posted
20130613 03:23:49 » 

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




Porlus


«
Reply #9  Posted
20130613 03:32:22 » 

Thanks for the reply. 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.




Games published by our own members! Check 'em out!


Jimmt


«
Reply #10  Posted
20130613 03:33:20 » 

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. 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.




Longarmx


«
Reply #11  Posted
20130613 05:33:41 » 

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. 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?




Jimmt


«
Reply #12  Posted
20130613 05:37:09 » 

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?
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.




HeroesGraveDev


«
Reply #13  Posted
20130613 06:34:24 » 

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.




pjt33


«
Reply #14  Posted
20130613 09:36:59 » 

Completing the square is the method that I recall the teacher saying takes too long to work out in an exam. 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.




Sammidysam


«
Reply #15  Posted
20130613 14:41:03 » 

Completing the square is way easier if the variable a in the quadratic equation does not have coefficients, e.g. x^{2} + 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.




Longarmx


«
Reply #16  Posted
20130613 16:12:50 » 

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?
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. Ah, I understand now. I guess just the way you worded it made me think differently.




Jimmt


«
Reply #17  Posted
20130613 18:12:14 » 

Completing the square is way easier if the variable a in the quadratic equation does not have coefficients, e.g. x^{2} + 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.
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: 5x ^{2} + 12x + 4  52  12  Cross multiply and add 5*2 + 2*1 = 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.




