77.32% of parents see better grades in 3 months!

The a² + b² formula (sum of squares formula) is a² + b² = (a + b)² − 2ab, or equivalently a² + b² = (a − b)² + 2ab. It finds the sum of two squares from the sum or difference of the two numbers and their product, without squaring each number separately.

a² + b² formula at a glance

a² + b² = (a + b)² − 2ab

a² + b² = (a − b)² + 2ab

In this guide:

  • what the formula means, with a quick numerical check
  • how to derive it, with a picture
  • which form to use for each type of question
  • 7 step-by-step solved examples, plus a separate section for IB students

For cube identities, see our (a + b)³ and a³ + b³ formulas guide.

Quick checklist: square identities

  • a² + b² = (a + b)² − 2ab, which you use when you know a + b and ab
  • a² + b² = (a − b)² + 2ab, which you use when you know a − b and ab
  • a² + b² = [(a + b)² + (a − b)²] ÷ 2, which you use when you know both a + b and a − b
  • a² + b² is not the same as (a + b)². The two differ by 2ab.
  • a² + b² has no real factors, unlike a² − b² = (a + b)(a − b)

What is the a² + b² formula?

The a² + b² formula (a square plus b square) writes the sum of two squares in terms of a + b or a − b, and ab:

a^2 + b^2 = (a + b)^2 - 2ab

‍

a^2 + b^2 = (a - b)^2 + 2ab

Use the first form when you know a + b, and the second when you know a − b.

Here a and b are any two numbers or algebraic terms, a² and b² are their squares, and ab is their product.

Quick check with numbers: take a = 3 and b = 4.

  • Directly: 3² + 4² = 9 + 16 = 25
  • With the formula: (3 + 4)² − 2(3)(4) = 49 − 24 = 25 ✓

Derivation of the a² + b² formula

  1. Expand (a + b)² = a² + 2ab + b².
  2. Subtract 2ab from both sides: (a + b)² − 2ab = a² + b².
  3. In the same way, (a − b)² = a² − 2ab + b². Add 2ab to both sides: (a − b)² + 2ab = a² + b².

[embed: node/a41388bd-0219]

The two shaded ab rectangles are exactly the 2ab that separates (a + b)² from a² + b². Take them away and only the two squares are left.

One more useful result: adding the two expansions gives (a + b)² + (a − b)² = 2(a² + b²).

Can a² + b² be factorised? Not with real numbers. Unlike a² − b², the sum of two squares has no real factors. With complex numbers, which IB Maths AA HL covers, a² + b² = (a + bi)(a − bi).

How to use the a² + b² formula

Pick the form that matches what the question gives you:

  1. Given a + b and ab: use a² + b² = (a + b)² − 2ab.
  2. Given a − b and ab: use a² + b² = (a − b)² + 2ab.
  3. Given a + b and a − b: add the two squares and halve: a² + b² = [(a + b)² + (a − b)²] ÷ 2.
  4. Given a + b and a² + b²: work backwards to find ab = [(a + b)² − (a² + b²)] ÷ 2.

Where the a² + b² formula is used

  • CBSE Class 8–9: algebraic identities, and finding values without solving for a and b
  • IGCSE: expanding, simplifying, and expressions like x² + 1/x²
  • IB Maths AA: advanced uses, covered in the IB section after the solved examples

Not to be confused with:

  • Pythagoras' theorem, a² + b² = c². This is a relationship between the sides of a right-angled triangle, not an algebraic identity that holds for all a and b.
  • The sum of squares of the first n natural numbers, 1² + 2² + … + n² = n(n + 1)(2n + 1) ÷ 6. This is a different "sum of squares" formula, used in series.

Solved examples

Each example follows the same steps: write what's given, choose the form, substitute, then simplify.

Example 1: Find 5² + 6² using the a² + b² formula

  • Given: a = 5, b = 6
  • Formula: a² + b² = (a + b)² − 2ab
  • Substitute: 5² + 6² = (5 + 6)² − 2(5)(6)
  • Simplify: = 11² − 60 = 121 − 60
  • Answer: 5² + 6² = 61

Example 2: Find 10² + 20² in two ways and check they agree

  • Method 1, directly: 10² + 20² = 100 + 400 = 500
  • Method 2, with the formula: given a = 10 and b = 20, (10 + 20)² − 2(10)(20) = 900 − 400 = 500
  • Answer: both methods give 500, so the formula checks out.

Example 3: If a + b = 7 and ab = 12, find a² + b²

  • Given: a + b = 7, ab = 12
  • Formula: we know the sum, so use a² + b² = (a + b)² − 2ab
  • Substitute: = 7² − 2(12)
  • Simplify: = 49 − 24
  • Answer: a² + b² = 25

Example 4: If a − b = 3 and ab = 10, find a² + b²

  • Given: a − b = 3, ab = 10
  • Formula: we know the difference, so use a² + b² = (a − b)² + 2ab
  • Substitute: = 3² + 2(10)
  • Simplify: = 9 + 20
  • Answer: a² + b² = 29

Example 5: If x + 1/x = 5, find x² + 1/x²

  • Given: a = x and b = 1/x, so a + b = 5 and ab = x × 1/x = 1
  • Formula: a² + b² = (a + b)² − 2ab
  • Substitute: = 5² − 2(1)
  • Simplify: = 25 − 2
  • Answer: x² + 1/x² = 23

Example 6: If a + b = 10 and a² + b² = 58, find ab

  • Given: a + b = 10, a² + b² = 58
  • Formula: a² + b² = (a + b)² − 2ab
  • Substitute: 58 = 10² − 2ab
  • Simplify: 2ab = 100 − 58 = 42
  • Answer: ab = 21

Example 7: If a + b = 8 and a − b = 2, find a² + b²

  • Given: a + b = 8, a − b = 2
  • Formula: a² + b² = [(a + b)² + (a − b)²] ÷ 2
  • Substitute: = (8² + 2²) ÷ 2
  • Simplify: = (64 + 4) ÷ 2
  • Answer: a² + b² = 34

For IB students: advanced uses of a² + b²

This section is for IB Maths AA students. If you're studying CBSE or IGCSE, you can skip to the common mistakes.

Sum of the squares of the roots of a quadratic

For roots α and β of ax² + bx + c = 0, you know α + β = −b/a and αβ = c/a. So:

\alpha^2 + \beta^2 = (\alpha + \beta)^2 - 2\alpha\beta

Example: the roots of x² − 5x + 3 = 0 are α and β. Find α² + β² without solving.

  • Given: α + β = 5, αβ = 3
  • Substitute: α² + β² = 5² − 2(3)
  • Answer: 19

Modulus of a complex number (AA HL)

The distance of a + bi from the origin is |a + bi| = √(a² + b²).

Example: find |3 + 4i|.

  • Substitute: √(3² + 4²) = √(9 + 16) = √25
  • Answer: 5

Common mistakes

  1. Writing a² + b² = (a + b)². The 2ab term is missing. Test with a = b = 1: (1 + 1)² = 4, but 1² + 1² = 2.
  2. Getting the sign of 2ab wrong. It is −2ab with (a + b)², and +2ab with (a − b)².
  3. Choosing the wrong form. If the question gives a − b, the (a + b)² form doesn't help.
  4. Trying to factorise a² + b². It has no real factors. Only a² − b² factorises.
  5. Confusing it with Pythagoras. a² + b² = c² only applies to right-angled triangles.
  6. Not squaring the coefficient. If a = 2x, then a² = 4x², not 2x².

Practice questions

  1. Use the a² + b² formula to find 7² + 8².
  2. Use the formula to find 12² + 15².
  3. If a + b = 9 and ab = 20, find a² + b².
  4. If a − b = 4 and ab = 12, find a² + b².
  5. If x + 1/x = 6, find x² + 1/x².
  6. If a + b = 11 and a² + b² = 61, find ab.
  7. (IB) The roots of x² − 7x + 10 = 0 are α and β. Find α² + β².
  8. (IB HL) Find |5 − 12i|.

Answers

  1. 15² − 2(56) = 225 − 112 = 113
  2. 27² − 2(180) = 729 − 360 = 369
  3. 81 − 40 = 41
  4. 16 + 24 = 40
  5. 36 − 2 = 34
  6. 2ab = 121 − 61 = 60, so ab = 30
  7. α + β = 7 and αβ = 10, so 49 − 20 = 29
  8. √(25 + 144) = 13

Frequently asked questions

What is the expansion of the a² + b² formula?

a² + b² = (a + b)² − 2ab. It can also be written as a² + b² = (a − b)² + 2ab.

What is the a square plus b square formula in algebra?

It is the sum of squares identity: a² + b² = (a + b)² − 2ab, or (a − b)² + 2ab. It is read aloud as "a square plus b square".

How do you use the a² + b² formula?

Use (a + b)² − 2ab when you know the sum and product of the two numbers. Use (a − b)² + 2ab when you know the difference and product.

How do you simplify numbers using the a² + b² formula?

Take a and b as the two numbers and substitute. For 20² + 30²: (20 + 30)² − 2(20)(30) = 2,500 − 1,200 = 1,300.

What is the difference between the a² + b² and a² − b² formulas?

a² + b² (sum of squares) = (a + b)² − 2ab and has no real factors. a² − b² (difference of squares) factorises as (a + b)(a − b).

Is a² + b² the same as (a + b)²?

No. (a + b)² = a² + 2ab + b², so the two differ by 2ab. They are only equal when a = 0 or b = 0.

Can a² + b² be factorised?

Not over real numbers. Over complex numbers, a² + b² = (a + bi)(a − bi), where i² = −1.

Is a² + b² the Pythagoras formula?

No. Pythagoras' theorem, a² + b² = c², applies only to the sides of a right-angled triangle. The a² + b² formula is an identity that holds for any a and b.

What is the sum of squares formula for n numbers?

The sum of the squares of the first n natural numbers is n(n + 1)(2n + 1) ÷ 6. That is a different formula from a² + b², which deals with just two terms.

Book your free demo class with MentorMatch

Algebraic identities sit under almost every topic that comes later. When they are shaky, factorising, quadratics and calculus all feel harder than they need to.

A MentorMatch tutor works one-to-one with your child, finds exactly where the method breaks down, and builds fluency with targeted practice.

Book Your Free Demo Class with MentorMatch.

Signup to start learning

Please enter a 10-digit phone number
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.