r/learnmath • New User • 1d ago

Understanding completing the square

I'm just brushing up on what I learnt in school, basically I was curious to see if I could still do it and it turns out, yes, but also no. I can pretty easily just remember what I'm told and repeat it, I just need to know why lol. Also this has been asked before but the threads are pretty dormant now, so apologies for more of the same.

An example I found on YouTube asks you to:

Write x²+10x+28 as (x+a)²+b

Work this out by breaking x²+10x into (x+5)(x+5) = (x*x)+(x*5)+(5*x)+(5*5) which simplifies to

x²+10x+25

Therefore x²+10x = x²+10x+25 which can't be true

Having multiplied out those brackets which spits out 25, we then answer the question as (x+5)² - 25 + 28

So, (x+5)² + 3

What I don't understand is how that 25 appeared and once we've got it, why we just conveniently subtract it because x²+10x =/= x²+10x+25

Why is the final solution not (x+5)²+53 ? I can just remember to subtract ½b² but whyyy

12 Upvotes

22 comments sorted by

10

u/Infobomb New User 1d ago

Why is the final solution not (x+5)²+53 ?

Because when you multiply that out, you don't get x²+10x+28 . Try it.

Therefore x²+10x = x²+10x+25 which can't be true

Nobody's claiming that's true. The calculation you've done isn't to find out what x²+10x equals. You're simply finding out (x + 5) multiplied by itself so you can see how different the result is from x²+10x+28.

5

u/hallerz87 New User 1d ago

(x+5)^2 = x^2 + 10x + 25. Add 3 to both sides. (x+5)^2 + 3 = x^2 + 10x + 28

2

u/LevainLaVidaLoca New User 1d ago

This approach is very easy to understand. Just add the difference of c instead of adding and subtracting 25 and adding c on top of it.

Thanks!

2

u/nog642 1d ago

"the difference of c" is c-25. So when you say "just add the difference of c", that looks like 25+(c-25)=c.

2

u/hwynac New User 1d ago

It depends on how you do it. If you just transform the original expression without any other notes in the margins, adding and subtracting the same stuff ensures you don't accidentally change the value.

x² + 10x + 28 = x² + 10x + 25 - 25 + 28 = (x + 5)² - 25 + 28 = (x + 5)² + 3

And everyone can check thess steps at any point. Sometimes things you add aren't as mental-math-friendly, so writing it down the dumb way is easier.

3

u/Bounded_sequencE New User 1d ago

Why is the final solution not (x+5)²+53 ? I can just remember to subtract ½b² but whyyy

That's "completing the square" -- we add/subtract 25 s.th. nothing changes:

x^2 + 10x + 28  =  (x^2 + 10x + 25) - 25 + 28

                =       (x+5)^2     - 25 + 28  =  (x+5)^2 + 3

The motivation is to add/subtract the term that completes the binomial formula "a2 + 2ab + b2 = (a+b)2 ".

3

u/LevainLaVidaLoca New User 1d ago

This was my first post in this sub and I am blown away by the speed and helpfulness of all of the responses.

3

u/Midwest-Dude B.Sc. Math 1d ago edited 1d ago

Wikipedia has a nice write-up on this here: 

Completing the Square

I kinda like the animation at the beginning, showing how this is worked out with real geometric squares along with algebra. 

Anyway, if you need to complete the square for a formula like x2 + ax + b, you figure out what needs to be added, and then subtracted, so the two formulas are equivalent, to turn the first two terms into a perfect square. Since the coefficient of the x term is added twice when squaring, half of that is needed to complete the square, that is,

(x2 + ax +(a/2)) + (b - a/2)

= (x + a/2)2 + ½(2b - a)

Notice how I added, and then subtracted, a/2.

The Wikipedia article does the more general case where x2 has a nonzero coefficient.

2

u/A_BagerWhatsMore New User 1d ago

x²+10x does not equal x²+10x+25 this is correct

x²+10x = x²+10x+25-25 is true though

you add +25 which becomes part of (x+5)^2 and so to balance it out you have to subtract 25

2

u/NexTutor New User 1d ago

You’re right: x² + 10x is not equal to (x + 5)². That’s exactly the missing step in the explanation.

Expanding gives:

(x + 5)² = x² + 10x + 25

So, to represent just x² + 10x, we have to subtract the extra 25:

x² + 10x = (x + 5)² − 25

Now include the original +28:

x² + 10x + 28

= (x + 5)² − 25 + 28

= (x + 5)² + 3

We’re not changing the expression and then conveniently undoing something later. We’re replacing part of it with an equal expression: x² + 10x becomes (x + 5)² − 25.

Why not +53? The square already contains the extra 25. Adding another 25 would count it twice.

A quick check with x = 0 makes this visible:

• Original: 0² + 10(0) + 28 = 28

• Correct form: (0 + 5)² + 3 = 28

• Your alternative: (0 + 5)² + 53 = 78

Also, the amount we subtract is (b/2)², not b²/2. Here b = 10, so half is 5, and its square is 25.

1

u/LevainLaVidaLoca New User 1d ago

This makes sense to me now too. The first part of your explanation makes the "why not +53" way more obvious, but the x=0 confirmation is also very helpful.

And yes, the (b/2)² was what I meant, I just wrote it down very badly.

Thanks!

2

u/Infamous-Chocolate69 New User 1d ago

If you're starting expression is x²+10x, the idea is to add and subtract 25 so that it doesn't change.
 x²+10x =  (x²+10x + 25) - 25. Then factor the trinomial to get,
x²+10x = (x+5)² - 25

Now if you want something like x²+10x + 28, you'd just add 28 to both sides.

1

u/fletchman93 New User 1d ago edited 1d ago

Edit: We are allowed to introduce this +25 to create a perfect square, because we immediately subtracted it. Therefore, all we did was add a "fancy" 0, which doesn't change the problem.

1) Make sure a=1. If not, factor out a from each term.

2) Look at the (possibly new) value of b. Divide b in 2 and square.

3) Add and then immediately subtract the value you find (this is where the 25 came from)

4) The first three terms can be factored into a perfect square and the last two terms simplify into some number. If those numbers add up to 0, you already had a perfect square.

1

u/YogurtclosetOk7654 New User 1d ago

You have (x+5)2 which is x2 + 10x + 25, but you want x2 + 10x. That’s 25 less. You can think about it like this:

if (x+5)2 = x2 + 10x + 25, then

(x+5)2 - 25 =  x2 + 10x + 25 -25, which = x2 + 10x

1

u/anisotropicmind New User 1d ago

You don’t “write x^2 + 10x as (x+5)(x+5)”. That’s nonsense, because as you point out, the two aren’t equal. The point is to notice that

x^2 + 10x + 28 = x^2 + 10x + 25 + 3

And then everything other than the 3 is a perfect square (it’s (x+5)^2).

So find a way to rewrite your expression as a perfect square + extra stuff.

Another way to look at it: the method given in your solution is right, but the way you described it is not. (x+5)(x+5) is indeed x^2 + 10x + 25. That’s bigger than the first two terms you have in your expression — it has an extra 25 in it that isn’t there. It follows that

x^2 + 10x = x^2 + 10x + 25 - 25

= (x+5)^2 - 25

Hope that helps!

1

u/General_Lee_Wright PhD 1d ago

> Therefore x²+10x = x²+10x+25 which can't be true

That’s not what your process is saying.

To complete the square you want (x+y)^2 but how do you find y? Well, (x+y)^2=x^2 + 2yx +y^2

Take the 10 in x^2 +10x and divide it by 2 to find the missing y. You get 5.

Now, (x+5)^2 = x^2 + 10x + 25. So to introduce the 25 to your problem you add and subtract it. Which gives you x^2 + 10x + 28 = (x^2 + 10x + 25) - 25 + 28.

Then using your newly created perfect square, you get (x+5)^2 + 3.

1

u/Dr0110111001101111 Teacher 1d ago

There’s a really nice way to visualize how/why completing the square works, and it’s thousands of years old, which I think is kind of cool.

Here is a write up describing how it works. You can skip down to the section titled “a different approach”. If you’re more of a video person, just search “completing the square area model” on YouTube and you should find plenty of videos demonstrating it.

1

u/waldosway PhD 1d ago

x2 + 10x + 28

= x2 + 10x + (25 - 25) + 28

= (x2 + 10x + 25) -25 + 28

1

u/Dapper-Tension6860 New User 1d ago edited 1d ago

(x+y)2 - y2 = x2 + 2xy + y2 -y2 = x2 + 2xy

= x2 + xy + yx

square -y2

square -xy

square -x2

x2 + xy + yx + y2 = (x+y)2 = square

1

u/TwoOneTwos Applied Math 20h ago

group the first two terms, factor out the number next to the leading exponent if you can, take the second term divide it by 2, square it, and then subtract it to itself, multiply the subtracted number by the coefficient you factored out (or just leave it) and then the contents in the inside represent a perfect square which you factor. Now you have it.

x^2 + 10x + 28 = (x^2 + 10x) + 28 = (x^2 + 10x + 25 - 25) + 28 = (x^2 + 10x + 25) + 28 - 25 = (x^2 + 10x + 25) + 3 = (x+5)^2 + 3.

1

u/Southlander24 A friendly Redditor!👋 13h ago

You're missing an essential step: add and subtract the same number. Nothing is changed this way.

Surely you agree that x² + 10x + 28 = x² + 10x + 25 - 25 + 28. Then, we complete the square to get (x + 5)2 - 25 + 28. Then collect the number terms to get (x + 5)2 + 3.

Your turn now. Suppose you have x2 + 12x + 13. I'll give you the perfect square, which is x2 + 12x + 36 (because 12/2 = 6, and 62 = 36). Using the 'add and subtract the same number' strategy, what is the next step you should write?