Explanation:
Okay, so I need to find the number of quadratic equations of the form $x^2 + ax + b = 0$ such that whenever $c$ is a root of the equation, then $c^2 - 2$ is also a root. Hmm, interesting problem. Let me try to break it down step by step.

First, let me recall that a quadratic equation has two roots (counting multiplicities). Let me denote the roots as $r$ and $s$. So, the equation is $x^2 + ax + b = 0$, and by Vieta's formulas, we know that:

- $r + s = -a$
- $rs = b$

Now, the condition given is that if $c$ is a root, then $c^2 - 2$ is also a root. So, this needs to hold for both roots. Let me think about what this implies.

Case 1: Suppose one of the roots is $r$. Then $r^2 - 2$ must also be a root. Similarly, if $s$ is a root, then $s^2 - 2$ must also be a root. However, since there are only two roots, this means that either $r^2 - 2 = r$ or $r^2 - 2 = s$, and similarly for $s$.

So, maybe I need to consider different scenarios here. Let me try to formalize this.

Let me denote the roots as $r$ and $s$. Then, according to the problem's condition:

- If $r$ is a root, then $r^2 - 2$ is also a root. Therefore, $r^2 - 2$ must be equal to either $r$ or $s$.
- Similarly, if $s$ is a root, then $s^2 - 2$ is also a root, so $s^2 - 2$ must be equal to either $s$ or $r$.

So, there are a few possibilities here. Let me consider the different cases.

Case 1: Both roots satisfy $c^2 - 2 = c$. That is, both roots are fixed points of the function $f(c) = c^2 - 2$. Let me solve $c^2 - 2 = c$. That equation becomes $c^2 - c - 2 = 0$, which factors as $(c - 2)(c + 1) = 0$. Therefore, the solutions are $c = 2$ or $c = -1$. So, if both roots are 2 and -1, then this condition is satisfied because applying $f$ to each gives themselves. Therefore, such an equation would be $(x - 2)(x + 1) = x^2 - x - 2$, so $a = -(-1) = 1$? Wait, hold on. Wait Vieta's formula: sum of roots is $2 + (-1) = 1 = -a$, so $a = -1$. Product is $2 * (-1) = -2 = b$. So the equation is $x^2 - x - 2 = 0$. So that's one equation.

But are there more equations in this case? Well, if both roots are fixed points, then the roots have to be 2 and -1. Because those are the only solutions to $c^2 - 2 = c$. Therefore, the only quadratic with both roots fixed points is this equation. So that's one equation.

Case 2: One root is a fixed point, and the other root is mapped to the first root. That is, suppose $r$ is a fixed point (so $r^2 - 2 = r$) and then $s^2 - 2 = r$. Similarly, if we have $s$ as a fixed point, then $r^2 - 2 = s$. Let me check both subcases.

Subcase 2a: $r^2 - 2 = r$ (so $r = 2$ or $-1$) and $s^2 - 2 = r$.

Similarly, since the equation has two roots, we need that if $r$ is a root, then $r^2 - 2$ is a root, which would be $s$ in this case, and vice versa.

So let's suppose that $r$ is a fixed point, so $r = 2$ or $-1$. Then, $s^2 - 2 = r$. Let's first take $r = 2$. Then, $s^2 - 2 = 2$, so $s^2 = 4$, so $s = 2$ or $s = -2$. But if $s = 2$, then both roots are 2, which would mean that the quadratic is $(x - 2)^2 = x^2 - 4x + 4$. Let me check if this satisfies the condition. If $c = 2$ is a root, then $c^2 - 2 = 4 - 2 = 2$, which is also a root. If the other root is 2, same thing. So this equation is okay. However, if $s = -2$, then the roots would be 2 and -2. Let me check if this works. Suppose $c = 2$, then $c^2 - 2 = 2$, which is already a root. If $c = -2$, then $c^2 - 2 = 4 - 2 = 2$, which is also a root. So this equation is okay too. So in this case, with $r = 2$, we get two possibilities: roots 2 and 2, or 2 and -2.

Similarly, if $r = -1$, then $s^2 - 2 = -1$, so $s^2 = 1$, so $s = 1$ or $s = -1$. If $s = -1$, then the equation has both roots -1, which would be $(x + 1)^2 = x^2 + 2x + 1$. Let me check: if $c = -1$, then $c^2 - 2 = 1 - 2 = -1$, which is also a root. So that works. If $s = 1$, then the roots are -1 and 1. Let me check: if $c = -1$, then $c^2 - 2 = -1$, which is a root. If $c = 1$, then $c^2 - 2 = 1 - 2 = -1$, which is also a root. So this equation is also okay. Therefore, for $r = -1$, we get two possibilities: roots -1 and -1, or -1 and 1.

So, in this case, Subcase 2a gives us four equations:

1. Roots 2 and 2: equation $x^2 - 4x + 4$
2. Roots 2 and -2: equation $x^2 - 0x - 4 = x^2 - 4$
3. Roots -1 and -1: equation $x^2 + 2x + 1$
4. Roots -1 and 1: equation $x^2 + 0x -1 = x^2 - 1$

Wait a second, but hold on, need to remember that these quadratics may have been considered in previous cases. For example, the equation with roots 2 and 2: is that different from the previous case where both roots are fixed points? In the first case, where both roots are fixed points, we had roots 2 and -1. So in this case, the equation with roots 2 and 2 is new. Similarly, roots -1 and -1 is new. So these are four equations from Case 2a.

But wait, also, we need to check if these equations have been counted in previous cases. In the first case, we had the equation with roots 2 and -1. So these are different. Therefore, we have four more equations here.

Subcase 2b: What if the other way around? Suppose that $s$ is a fixed point, and $r^2 - 2 = s$. But isn't this the same as Subcase 2a? Because if $r$ is a fixed point and $s^2 - 2 = r$, then if we consider $s$ being a fixed point, then $s$ would have to satisfy $s^2 - 2 = s$, meaning $s$ is 2 or -1, and then $r^2 - 2 = s$. Which is similar to what we did in Subcase 2a. So maybe Subcase 2a and 2b are actually overlapping? Maybe there isn't a separate case here, since we already considered both possibilities. So perhaps we have covered all possibilities in Subcase 2a.

Case 3: Neither root is a fixed point, but applying the function $f(c) = c^2 - 2$ to each root leads to the other root. That is, $r^2 - 2 = s$ and $s^2 - 2 = r$. So, both roots are mapped to each other under the function $f$. Let me analyze this case.

So, if $r^2 - 2 = s$ and $s^2 - 2 = r$, then we can set up a system of equations. Let me write:

From the first equation: $s = r^2 - 2$

Plugging this into the second equation: $(r^2 - 2)^2 - 2 = r$

Expanding that: $r^4 - 4r^2 + 4 - 2 = r$, so $r^4 - 4r^2 + 2 - r = 0$, which is $r^4 - 4r^2 - r + 2 = 0$

So, we need to solve this quartic equation. Let me see if I can factor it or find rational roots.

Using Rational Root Theorem: possible rational roots are ±1, ±2.

Let me test r = 1: 1 - 4 - 1 + 2 = -2 ≠ 0

r = -1: 1 - 4 + 1 + 2 = 0. Oh, so r = -1 is a root.

So, we can factor out (r + 1). Let me perform polynomial division or use synthetic division.

Divide $r^4 - 4r^2 - r + 2$ by (r + 1).

Using synthetic division for root -1:

Coefficients: 1 (r^4), 0 (r^3), -4 (r^2), -1 (r), 2 (constant)

Bring down the 1

Multiply by -1: -1

Add to next coefficient: 0 + (-1) = -1

Multiply by -1: 1

Add to next coefficient: -4 + 1 = -3

Multiply by -1: 3

Add to next coefficient: -1 + 3 = 2

Multiply by -1: -2

Add to last coefficient: 2 + (-2) = 0. Perfect.

So, the quartic factors as (r + 1)(r^3 - r^2 - 3r + 2). Now, let's factor the cubic: $r^3 - r^2 - 3r + 2$.

Again, using Rational Root Theorem: possible roots are ±1, ±2.

Testing r=1: 1 - 1 - 3 + 2 = -1 ≠ 0

r=2: 8 - 4 - 6 + 2 = 0. So r=2 is a root.

Therefore, factor out (r - 2):

Using synthetic division on r^3 - r^2 - 3r + 2 with root 2:

Coefficients: 1, -1, -3, 2

Bring down 1

Multiply by 2: 2

Add to next coefficient: -1 + 2 = 1

Multiply by 2: 2

Add to next coefficient: -3 + 2 = -1

Multiply by 2: -2

Add to last coefficient: 2 + (-2) = 0

Therefore, the cubic factors as (r - 2)(r^2 + r - 1). Therefore, overall, the quartic factors as:

(r + 1)(r - 2)(r^2 + r - 1)

Therefore, the roots of the quartic equation are:

r = -1, r = 2, and roots of $r^2 + r - 1 = 0$, which are $r = [-1 ± √(1 + 4)] / 2 = [-1 ± √5]/2$.

So, going back, the quartic equation $r^4 - 4r^2 - r + 2 = 0$ has roots -1, 2, and $[-1 ± √5]/2$.

But remember, in this case, we were looking for solutions where $r$ and $s$ satisfy $s = r^2 - 2$ and $r = s^2 - 2$. Therefore, for each root $r$ of the quartic, we can find the corresponding $s$, but we need to check if they form distinct roots or not.

First, take r = -1:

Then s = (-1)^2 - 2 = 1 - 2 = -1. So s = -1, which is the same as r. Therefore, this corresponds to the case where both roots are -1, which we had considered in Case 2a. So that equation is already counted there.

Next, take r = 2:

s = (2)^2 - 2 = 4 - 2 = 2. Again, same as r. So this corresponds to the case where both roots are 2, which was also counted in Case 2a.

Now, take the roots $r = [-1 + √5]/2$ and $r = [-1 - √5]/2$. Let me compute s for each.

Let me denote $r_1 = [-1 + √5]/2$ and $r_2 = [-1 - √5]/2$. Then, compute s = r^2 - 2 for each.

First, compute $r_1^2 - 2$:

Let me compute $r_1^2$:

$([-1 + √5]/2)^2 = [1 - 2√5 + 5]/4 = [6 - 2√5]/4 = [3 - √5]/2.

Therefore, $r_1^2 - 2 = [3 - √5]/2 - 2 = [3 - √5 - 4]/2 = [-1 - √5]/2 = r_2$.

Similarly, for $r_2^2 - 2$:

$([-1 - √5]/2)^2 = [1 + 2√5 + 5]/4 = [6 + 2√5]/4 = [3 + √5]/2.

Then, $r_2^2 - 2 = [3 + √5]/2 - 2 = [3 + √5 - 4]/2 = [-1 + √5]/2 = r_1$.

Therefore, these two roots $r_1$ and $r_2$ satisfy $s = r^2 - 2$ and vice versa. Therefore, the quadratic equation with roots $r_1$ and $r_2$ will satisfy the condition that if c is a root, then $c^2 - 2$ is also a root. Let me confirm that.

Suppose $c = r_1$, then $c^2 - 2 = r_2$, which is another root. Similarly for $c = r_2$, $c^2 - 2 = r_1$. Therefore, this equation satisfies the condition. Therefore, this is another quadratic equation.

So, in Case 3, we get two more equations: one with roots $[-1 + √5]/2$ and $[-1 - √5]/2$, and another one? Wait, no, this is a quadratic equation with these two roots, so only one equation here. Wait, but earlier, in Case 2a, we had equations with roots 2 and -2, and -1 and 1, etc. So, this is a new equation. Let me compute its coefficients.

Let me compute the quadratic equation with roots $r_1$ and $r_2$, where $r_1 + r_2 = [(-1 + √5)/2 + (-1 - √5)/2] = (-2)/2 = -1$. So the sum of roots is -1, so $-a = -1$, so $a = 1$. The product $r_1 r_2$ is equal to [(-1 + √5)/2] * [(-1 - √5)/2] = [(-1)^2 - (√5)^2]/4 = [1 - 5]/4 = (-4)/4 = -1. Therefore, the product is -1, so $b = -1$. Therefore, the equation is $x^2 + ax + b = x^2 + x - 1 = 0$. Wait, hold on: Vieta's formula says that $r + s = -a$ and $rs = b$. Therefore, since $r + s = -1 = -a$, so $a = 1$, and $rs = -1 = b$. Therefore, the equation is $x^2 + x - 1 = 0$. So that's the equation. So that's another equation.

But wait, earlier in Case 2a, we had equations like $x^2 - 1 = 0$, which has roots 1 and -1. Wait, but in this case, we have $x^2 + x - 1 = 0$, which has roots $[-1 ± √5]/2$. So that's different. So this is a new equation.

So in Case 3, we have one equation here. However, we need to check if there are more equations in this case. For example, is there another quadratic equation where applying the transformation swaps the roots? But since we have only two roots, and they are mapped to each other, which gives us one equation. However, note that the quartic had three roots (-1, 2, and the two others). But the ones corresponding to -1 and 2 lead to equations already considered in Case 2a, so only the two irrational roots give us a new equation here.

Wait, but hold on. Let me check if there are other possibilities in Case 3. Suppose that maybe there is another pair of roots that satisfy the condition? But since we solved the equation $r^4 - 4r^2 - r + 2 = 0$ and found all solutions, so we have covered all possibilities.

Therefore, Case 3 gives us one new equation: $x^2 + x - 1 = 0$.

Wait, but hold on, I need to check if there are other cases. For example, maybe there are quadratics where both roots are mapped to each other, but with multiplicities? Wait, but quadratics can't have multiplicities unless they have a double root, but in that case, the equation would be like $(x - r)^2$, so then the root is r, and applying $f(r)$ would need to be r, so that would be Case 1 or 2a. So those are already considered.

Therefore, compiling all the cases:

Case 1: Quadratic with roots 2 and -1: equation $x^2 - x - 2 = 0$.

Case 2a: Quadratic with roots (2, 2), (2, -2), (-1, -1), (-1, 1): equations $x^2 - 4x + 4$, $x^2 - 4$, $x^2 + 2x + 1$, $x^2 - 1$.

Case 3: Quadratic with roots $[-1 ± √5]/2$: equation $x^2 + x - 1 = 0$.

But now, we need to check if there are overlaps between these cases. For example, the equation $x^2 - 1 = 0$ has roots 1 and -1, which was considered in Case 2a. Similarly, equation $x^2 - 4 = 0$ has roots 2 and -2, also considered in Case 2a. The equation $x^2 + 2x + 1 = 0$ is (x + 1)^2, and $x^2 - 4x + 4$ is (x - 2)^2. So these are all separate equations. Case 1 is separate. Case 3 is another separate equation.

So in total, how many equations do we have?

Case 1: 1 equation.

Case 2a: 4 equations.

Case 3: 1 equation.

Total: 1 + 4 + 1 = 6 equations.

But wait, let me verify each of these equations to make sure they satisfy the condition.

First, Case 1: $x^2 - x - 2 = 0$. Roots are 2 and -1. Then, for root 2: $2^2 - 2 = 2$, which is a root. For root -1: $(-1)^2 - 2 = 1 - 2 = -1$, which is a root. So good.

Case 2a equations:

1. $x^2 -4x +4 = 0$: roots 2 and 2. For root 2: 2^2 -2 = 2, which is a root. So yes.

2. $x^2 -4 =0$: roots 2 and -2. For 2: 2^2 -2 = 2, which is a root. For -2: (-2)^2 -2 = 4 -2 = 2, which is a root. So yes.

3. $x^2 + 2x +1 =0$: roots -1 and -1. For -1: (-1)^2 -2 = 1 -2 = -1, which is a root. So yes.

4. $x^2 -1 =0$: roots 1 and -1. For root 1: 1^2 -2 = -1, which is a root. For root -1: (-1)^2 -2 = -1, which is a root. So yes.

Case 3: $x^2 + x -1 =0$. Roots are $[-1 ± √5]/2$. As checked before, if you take either root, applying the function gives the other root. So yes, satisfies the condition.

So that seems 1 + 4 +1 = 6 equations. However, wait, but in Case 3, we only have one equation. Let me check if there are more equations in this case?

Wait, the quartic equation had roots -1, 2, and the two irrational roots. But for roots -1 and 2, they lead to equations already considered in Case 2a. The two irrational roots form a pair which gives the equation in Case 3. Therefore, only one equation here. So total 6 equations.

But wait, let me check if there are other quadratics that might satisfy the condition. For example, suppose there is a quadratic with roots that are not fixed points or swapped, but maybe something else?

Wait, suppose there is a quadratic with three roots? But no, quadratic has only two roots. So, unless there's some overlap or repetition. For example, if a root maps to itself and another root maps to the first root? Wait, but that was considered in Case 2a.

Alternatively, maybe quadratics with complex roots? Wait, the problem didn't specify that the roots have to be real. Hmm, but maybe I need to check that. Wait, but if the equation has complex roots, then applying $c^2 - 2$ might result in other complex numbers. However, the question says "whenever c is a root of the equation, c^2 - 2 is also a root". So even if the roots are complex, as long as the transformation maps roots to other roots, which are also in the set. But in our previous cases, we considered real roots. However, the problem didn't specify whether the roots are real or complex. So maybe there are more equations with complex roots.

Wait, but the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so a and b are presumably real numbers? Wait, the problem doesn't specify, but in Olympiad problems, unless stated otherwise, coefficients are usually real. However, even if they are complex, we can consider them. Let me check if there are equations with complex roots that satisfy the condition.

But in our previous analysis, we considered all roots, real or complex. For example, the equation $x^2 + x -1 = 0$ has real roots. Wait, but the quartic we solved included real roots. However, perhaps there are other equations with complex roots?

Wait, but when we considered Case 3, the roots $[-1 ± √5]/2$ are real. The other roots from the quartic were -1 and 2, real numbers. So, are there complex roots that could satisfy the condition?

Let me think. Suppose that there is a quadratic with complex roots such that if you take a root, apply $c^2 - 2$, you get another root, which may be complex. However, since the coefficients are real (probably), complex roots come in conjugate pairs. Let me suppose that the quadratic has complex roots $p$ and $\overline{p}$. Then, if $p$ is a root, then $p^2 - 2$ must be a root. Since the coefficients are real, $p^2 - 2$ must be either $p$ or $\overline{p}$. Let me consider possibilities.

If $p^2 - 2 = p$, then solving $p^2 - p -2 = 0$, which gives real roots 2 and -1, which we already considered. So, complex roots would require that $p^2 - 2 = \overline{p}$. Let me suppose that $p$ is a complex number such that $p^2 - 2 = \overline{p}$. Let me write $p = a + bi$, then $\overline{p} = a - bi$. Then:

$p^2 = (a + bi)^2 = a^2 - b^2 + 2abi$. Therefore, $p^2 - 2 = (a^2 - b^2 - 2) + 2abi$. Setting this equal to $\overline{p} = a - bi$, so:

Real part: $a^2 - b^2 - 2 = a$

Imaginary part: $2ab = -b$

Let me solve the imaginary part first: $2ab = -b$. If b ≠ 0, then 2a = -1 ⇒ a = -1/2. If b = 0, then p is real, which we already considered.

So, assuming b ≠ 0, then a = -1/2. Then, plugging into real part:

(-1/2)^2 - b^2 - 2 = -1/2 ⇒ 1/4 - b^2 - 2 = -1/2 ⇒ (-b^2) - 7/4 = -1/2 ⇒ -b^2 = -1/2 + 7/4 = 5/4 ⇒ b^2 = -5/4. Which is impossible, since b is real. Therefore, no solutions in this case. Therefore, there are no complex roots (other than real ones) that satisfy the condition.

Therefore, all solutions are covered in the previous cases, and there are no complex quadratics with distinct complex roots that satisfy the condition. Therefore, our previous count of 6 equations is correct.

But wait, let me check once again. Let me list all equations:

Case 1: Roots 2 and -1: equation $x^2 - x - 2 = 0$.

Case 2a:

1. Roots 2 and 2: $x^2 - 4x + 4 = 0$

2. Roots 2 and -2: $x^2 - 4 = 0$

3. Roots -1 and -1: $x^2 + 2x + 1 = 0$

4. Roots -1 and 1: $x^2 - 1 = 0$

Case 3: Roots $[-1 ± √5]/2$: $x^2 + x - 1 = 0$

So total of 1 + 4 + 1 = 6 equations. Therefore, the answer is 6?

Wait, but let me check if there are duplicates. For example, is $x^2 -1 = 0$ considered in Case 2a? Yes, as the roots -1 and 1. And the equation $x^2 + x -1 = 0$ is different from all others. Similarly, the other equations are distinct. So 6 equations.

But let me check for possible other equations. For example, suppose the quadratic has a root c such that applying the function twice brings it back. Wait, but that might be already considered. For example, if c is a root, then c^2 -2 is another root, and then applying the function again, (c^2 -2)^2 -2 should be a root. But since there are only two roots, this would mean that either (c^2 -2)^2 -2 is equal to c or to c^2 - 2.

But in our previous cases, this is already considered. For example, in Case 3, the roots are such that applying the function once swaps them, so applying it twice returns to the original. In Case 1, applying the function leaves it the same. In Case 2a, for roots like 2 and -2, if you take 2, apply the function you get 2, same for -2, applying function gives 2, which is a root. So in that case, applying twice still gives the same thing.

Therefore, all possibilities are covered.

Wait, but hold on. Let me check equation $x^2 - 4x + 4 = 0$, which has a double root at 2. Then, according to the problem statement, whenever c is a root, c^2 -2 is also a root. Since there is only one root, 2, then c^2 -2 is 2, which is the same root, so it's okay. Similarly for other equations with double roots.

So, all 6 equations satisfy the condition. However, I need to make sure that there are no other quadratics. Wait, let me check if maybe the quartic in Case 3 could have more equations. For example, could there be another pair of roots that satisfy the condition?

Wait, the quartic equation was derived from the condition that applying the function twice maps a root to itself. So, the solutions of the quartic are the roots that satisfy this, but in the Case 3, only the two irrational roots lead to a new quadratic equation. The other roots led to equations already considered. Therefore, no other quadratics.

Wait, but what if there is a quadratic with both roots such that applying the function gives a root, but not necessarily the same as the previous? For example, suppose we have a quadratic where one root maps to the other, and that other maps to some other root? But since there are only two roots, the other root must be one of the existing roots. So, this is already covered in Cases 2 and 3.

Therefore, I think the total number of such quadratics is 6. But let me check again for possible mistakes.

Wait, in Case 2a, we had 4 equations. Let me list their equations again:

1. $x^2 - 4x + 4 = 0$ (double root 2)

2. $x^2 - 4 = 0$ (roots 2 and -2)

3. $x^2 + 2x + 1 = 0$ (double root -1)

4. $x^2 - 1 = 0$ (roots -1 and 1)

Case 1: $x^2 - x - 2 = 0$ (roots 2 and -1)

Case 3: $x^2 + x - 1 = 0$ (roots $[-1 ± √5]/2$)

Yes, 6 equations. But let me check if there's another equation that was missed. For example, suppose a quadratic equation with roots 1 and something. Wait, if we take the equation $x^2 - 1 = 0$, which is already considered. Or if there is another equation with roots 1 and something else? Let me check.

Suppose we have a root r and s, where r maps to s and s maps to r, which is Case 3. But we considered that. If there is another pair of roots where r maps to s and s maps to r, but different from Case 3? But the quartic equation we solved was the only possible such pair. Therefore, no.

Alternatively, perhaps equations with roots that are fixed points and something else? But that was covered in Case 2a.

Alternatively, are there equations where one root maps to itself and the other maps to the first root? Which was covered in Case 2a. For example, the equation with roots 2 and -2: 2 maps to itself, and -2 maps to 2. Similarly, equation with roots -1 and 1: -1 maps to itself, and 1 maps to -1. Wait, no. Wait, for equation with roots -1 and 1:

For root -1: (-1)^2 - 2 = 1 - 2 = -1, which is a root. For root 1: (1)^2 - 2 = 1 - 2 = -1, which is a root. Therefore, the root 1 maps to -1, and -1 maps to itself. Therefore, this is similar to Subcase 2a where one root is fixed and the other maps to it. Therefore, covered.

So, I think all possibilities are covered. Hence, total 6 equations.

But let me check again if the equation $x^2 + x -1 = 0$ is indeed valid. Let me take a root of that equation, say $r = [-1 + √5]/2 ≈ (-1 + 2.236)/2 ≈ 0.618$. Then $c^2 - 2 ≈ (0.618)^2 - 2 ≈ 0.618*0.618 ≈ 0.381 - 2 ≈ -1.619$. Which is approximately $[-1 - √5]/2 ≈ (-1 - 2.236)/2 ≈ -1.618$. So that's the other root. So yes, the condition is satisfied. Similarly for the other root. So this equation works.

Similarly, check equation $x^2 - x - 2 = 0$, roots 2 and -1. 2 maps to 2, -1 maps to -1. So that's okay.

So seems okay.

Therefore, unless there's something missing, the total number is 6. However, let me check once again if there are equations with different a and b values. For example, is there an equation like $x^2 + ax + b = 0$ which is not among the six I listed? For example, could there be an equation with roots 2 and something else?

Wait, if the equation has roots 2 and something else, say, root s. Then, according to the condition, s^2 - 2 must be a root. Since roots are 2 and s, then s^2 - 2 must be either 2 or s. So:

Case A: s^2 - 2 = 2 ⇒ s^2 = 4 ⇒ s = ±2. So then equations are:

- s=2: double root 2, equation $x^2 -4x +4$

- s=-2: roots 2 and -2, equation $x^2 -4$

Case B: s^2 - 2 = s ⇒ s^2 - s -2 = 0 ⇒ s = 2 or -1. So:

- s=2: same as above, double root 2.

- s=-1: equation with roots 2 and -1, which is Case 1.

Therefore, all possibilities covered. Similarly for other roots.

Therefore, I think the total number of equations is indeed 6.

Wait, but hold on. Wait, when we had Case 2a, we had equations with roots 2 and -2, and -1 and 1. However, the equation with roots 2 and -2: if we think of the roots, then for each root:

- For 2: 2^2 - 2 = 2, which is a root.

- For -2: (-2)^2 -2 = 4 - 2 = 2, which is a root. Therefore, this works. Similarly for roots -1 and 1:

For -1: (-1)^2 - 2 = -1, which is a root.

For 1: 1^2 - 2 = -1, which is a root. Therefore, works. So these are valid.

Therefore, I think 6 equations are correct. However, let me check the equations:

List of equations:

1. $x^2 - x - 2 = 0$ (roots 2, -1)

2. $x^2 - 4x + 4 = 0$ (roots 2, 2)

3. $x^2 - 4 = 0$ (roots 2, -2)

4. $x^2 + 2x + 1 = 0$ (roots -1, -1)

5. $x^2 - 1 = 0$ (roots 1, -1)

6. $x^2 + x - 1 = 0$ (roots $[-1 ± \sqrt{5}]/2$)

That's six equations. Therefore, the answer should be 6.

But wait, I need to check if equations 1 and 5 are distinct. For equation 1, roots are 2 and -1. For equation 5, roots are $[-1 ± √5]/2$, which are different numbers, so they are different equations. Similarly, others are distinct. So yes, six equations.

Wait, but let me check if there's an equation with roots 2 and -1. But equation 1 is that. Then, equation 5 is different. So no overlaps.

Alternatively, maybe some equations are duplicates? For example, equation 5 is $x^2 + x -1 = 0$, which isn't same as others. So, yes, six equations.

But wait, the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so different a and b. Let me check if any of these equations have same coefficients.

Equation 1: a = -1, b = -2.

Equation 2: a = -4, b = 4.

Equation 3: a = 0, b = -4.

Equation 4: a = 2, b = 1.

Equation 5: a = -1, b = -1? Wait no:

Wait equation 5 is $x^2 - 1 = 0$, so a = 0, b = -1. Wait no:

Wait Vieta's formula: For equation 5, $x^2 - 1 = 0$, so sum of roots is 0, product is -1. Therefore, for equation $x^2 + ax + b = 0$, we have a = 0 and b = -1. So equation 5 is a=0, b=-1.

Equation 1: a = -1, b = -2.

Equation 2: a = -4, b = 4.

Equation 3: a = 0, b = -4.

Equation 4: a = 2, b = 1.

Equation 6: $x^2 + x -1 = 0$, so a = 1, b = -1.

So all equations have distinct (a, b) pairs. Therefore, they are all distinct equations. Therefore, total number is 6.

But let me check once again. For example, is there any other equation? Let me think:

Suppose we have a quadratic with both roots mapping to each other. Wait, we already considered that in Case 3, giving equation 6.

Alternatively, quadratics where both roots are fixed points: equation 1.

Quadratics where one root is fixed and the other maps to it: equations 2, 3, 4, 5.

Hence, 1 + 4 + 1 = 6.

Alternatively, maybe the equation $x^2 + x - 1 = 0$ is the same as another equation? No, different coefficients.

Therefore, I think the answer is 6.

Wait, but let me check if the problem counts equations with different a and b as different even if they have the same roots but different coefficients? No, wait, no. For example, if two equations have same roots, they are same equation. But in our list, equations 2, 4, 5, and 3 are different: equation 2 is double root 2, equation 3 is roots 2 and -2, equation 4 is double root -1, equation 5 is roots -1 and 1. So they are different equations.

So, yes, 6 equations. So I think the answer is 6. However, I recall sometimes in such problems, equations with leading coefficient 1 are considered, but since the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so leading coefficient is 1, so no issues there.

Therefore, I think the final answer is 6. However, I have a doubt because sometimes problems like this might have symmetries or other constraints. Wait, let me check again the quartic equation. The quartic was $r^4 - 4r^2 - r + 2 = 0$, which factors as (r + 1)(r - 2)(r^2 + r - 1). Therefore, the quadratic factor is r^2 + r - 1, leading to equation x^2 + x - 1 = 0. Therefore, only one equation here. So yes, Case 3 gives one equation. So total 1 + 4 + 1 = 6.

Alternatively, maybe I should check if equations with roots that are the same as Case 1 are overlapping? For example, equation 1 has roots 2 and -1. Are there any other equations with roots 2 and -1? No, because the equation is uniquely determined by its roots. So it's only one equation.

Therefore, yes, total number is 6. Therefore, I think the answer is \boxed{6}.

**Final Answer**
\boxed{6}

To determine the number of quadratic equations of the form
$$
x^2 + ax + b = 0
$$
such that **whenever $ c $ is a root of the equation, $ c^2 - 2 $ is also a root**, we proceed systematically by analyzing the problem's structural constraints.

---

### Step 1: Understanding the Root Mapping Condition

Let the **roots of the quadratic** be $ r $ and $ s $. The condition says that **if $ c $ is a root, then $ c^2 - 2 $ is also a root**. Since a quadratic can have at most two roots, this leads to different scenarios:

1. **Case 1: Fixed Points**
   A root $ r $ is a **fixed point** if $ r^2 - 2 = r $. Solving this:

   $$
   r^2 - r - 2 = 0 \Rightarrow (r - 2)(r + 1) = 0 \Rightarrow r = 2 \text{ or } r = -1
   $$

   So, if the roots are $ 2 $ and $ -1 $, then:
   - $ 2^2 - 2 = 2 $, and
   - $ (-1)^2 - 2 = -1 $

   This satisfies the condition. So, the corresponding equation is:

   $$
   (x - 2)(x + 1) = x^2 - x - 2
   $$

   → **Equation (1):** $ x^2 - x - 2 $

2. **Case 2: One Fixed Point, the Other Mapping to the First Root**
   Suppose one root $ r = 2 $ (a fixed point), and the other root $ s $ satisfies:

   $$
   s^2 - 2 = 2 \Rightarrow s^2 = 4 \Rightarrow s = \pm2
   $$

   So, possible pairs are:
   - $ (2, 2) \Rightarrow x^2 - 4x + 4 $
   - $ (2, -2) \Rightarrow x^2 - 4 $

   Similarly, if $ r = -1 $, then the other root $ s $ satisfies:

   $$
   s^2 - 2 = -1 \Rightarrow s^2 = 1 \Rightarrow s = \pm1
   $$

   So, possible pairs are:
   - $ (-1, -1) \Rightarrow x^2 + 2x + 1 $
   - $ (-1, 1) \Rightarrow x^2 - 1 $

   → **Equations (2–5):**
   - $ x^2 - 4x + 4 $ (double root 2)
   - $ x^2 - 4 $ (roots 2 and -2)
   - $ x^2 + 2x + 1 $ (double root -1)
   - $ x^2 - 1 $ (roots -1 and 1)

3. **Case 3: Roots Mapping to Each Other**
   Here, suppose root $ r $ maps to root $ s $, and vice versa, i.e.:

   $$
   r^2 - 2 = s \quad \text{and} \quad s^2 - 2 = r
   $$

   Substituting $ s = r^2 - 2 $ into the second equation yields:

   $$
   (r^2 - 2)^2 - 2 = r \Rightarrow r^4 - 4r^2 - r + 2 = 0
   $$

   Solving this quartic, we factor:

   $$
   (r + 1)(r - 2)(r^2 + r - 1) = 0
   $$

   Roots are $ r = -1 $, $ r = 2 $, and the roots of $ r^2 + r - 1 = 0 $, i.e.,

   $$
   r = \frac{-1 \pm \sqrt{5}}{2}
   $$

   These two irrational roots form a **new quadratic** with sum and product:

   - Sum = $ \frac{-1 + \sqrt{5}}{2} + \frac{-1 - \sqrt{5}}{2} = -1 $
   - Product = $ \frac{(-1+\sqrt{5})(-1-\sqrt{5})}{4} = \frac{1 - 5}{4} = -1 $

   So, the corresponding equation is:

   $$
   x^2 + x - 1
   $$

   This is a new valid equation where the roots are mapped to each other, satisfying the condition.

   → **Equation (6):** $ x^2 + x - 1 $

---

### Step 2: Counting the Distinct Equations

From the above cases, we have:

- **Case 1**: 1 equation
- **Case 2**: 4 equations
- **Case 3**: 1 equation

Thus, the total number of such quadratic equations is:

$$
\boxed{6}
$$

[Assistant]
Explanation:
Okay, so I need to find the number of quadratic equations of the form $x^2 + ax + b = 0$ such that whenever $c$ is a root of the equation, then $c^2 - 2$ is also a root. Hmm, interesting problem. Let me try to break it down step by step.

First, let me recall that a quadratic equation has two roots (counting multiplicities). Let me denote the roots as $r$ and $s$. So, the equation is $x^2 + ax + b = 0$, and by Vieta's formulas, we know that:

- $r + s = -a$
- $rs = b$

Now, the condition given is that if $c$ is a root, then $c^2 - 2$ is also a root. So, this needs to hold for both roots. Let me think about what this implies.

Case 1: Suppose one of the roots is $r$. Then $r^2 - 2$ must also be a root. Similarly, if $s$ is a root, then $s^2 - 2$ must also be a root. However, since there are only two roots, this means that either $r^2 - 2 = r$ or $r^2 - 2 = s$, and similarly for $s$.

So, maybe I need to consider different scenarios here. Let me try to formalize this.

Let me denote the roots as $r$ and $s$. Then, according to the problem's condition:

- If $r$ is a root, then $r^2 - 2$ is also a root. Therefore, $r^2 - 2$ must be equal to either $r$ or $s$.
- Similarly, if $s$ is a root, then $s^2 - 2$ is also a root, so $s^2 - 2$ must be equal to either $s$ or $r$.

So, there are a few possibilities here. Let me consider the different cases.

Case 1: Both roots satisfy $c^2 - 2 = c$. That is, both roots are fixed points of the function $f(c) = c^2 - 2$. Let me solve $c^2 - 2 = c$. That equation becomes $c^2 - c - 2 = 0$, which factors as $(c - 2)(c + 1) = 0$. Therefore, the solutions are $c = 2$ or $c = -1$. So, if both roots are 2 and -1, then this condition is satisfied because applying $f$ to each gives themselves. Therefore, such an equation would be $(x - 2)(x + 1) = x^2 - x - 2$, so $a = -(-1) = 1$? Wait, hold on. Wait Vieta's formula: sum of roots is $2 + (-1) = 1 = -a$, so $a = -1$. Product is $2 * (-1) = -2 = b$. So the equation is $x^2 - x - 2 = 0$. So that's one equation.

But are there more equations in this case? Well, if both roots are fixed points, then the roots have to be 2 and -1. Because those are the only solutions to $c^2 - 2 = c$. Therefore, the only quadratic with both roots fixed points is this equation. So that's one equation.

Case 2: One root is a fixed point, and the other root is mapped to the first root. That is, suppose $r$ is a fixed point (so $r^2 - 2 = r$) and then $s^2 - 2 = r$. Similarly, if we have $s$ as a fixed point, then $r^2 - 2 = s$. Let me check both subcases.

Subcase 2a: $r^2 - 2 = r$ (so $r = 2$ or $-1$) and $s^2 - 2 = r$.

Similarly, since the equation has two roots, we need that if $r$ is a root, then $r^2 - 2$ is a root, which would be $s$ in this case, and vice versa.

So let's suppose that $r$ is a fixed point, so $r = 2$ or $-1$. Then, $s^2 - 2 = r$. Let's first take $r = 2$. Then, $s^2 - 2 = 2$, so $s^2 = 4$, so $s = 2$ or $s = -2$. But if $s = 2$, then both roots are 2, which would mean that the quadratic is $(x - 2)^2 = x^2 - 4x + 4$. Let me check if this satisfies the condition. If $c = 2$ is a root, then $c^2 - 2 = 4 - 2 = 2$, which is also a root. If the other root is 2, same thing. So this equation is okay. However, if $s = -2$, then the roots would be 2 and -2. Let me check if this works. Suppose $c = 2$, then $c^2 - 2 = 2$, which is already a root. If $c = -2$, then $c^2 - 2 = 4 - 2 = 2$, which is also a root. So this equation is okay too. So in this case, with $r = 2$, we get two possibilities: roots 2 and 2, or 2 and -2.

Similarly, if $r = -1$, then $s^2 - 2 = -1$, so $s^2 = 1$, so $s = 1$ or $s = -1$. If $s = -1$, then the equation has both roots -1, which would be $(x + 1)^2 = x^2 + 2x + 1$. Let me check: if $c = -1$, then $c^2 - 2 = 1 - 2 = -1$, which is also a root. So that works. If $s = 1$, then the roots are -1 and 1. Let me check: if $c = -1$, then $c^2 - 2 = -1$, which is a root. If $c = 1$, then $c^2 - 2 = 1 - 2 = -1$, which is also a root. So this equation is also okay. Therefore, for $r = -1$, we get two possibilities: roots -1 and -1, or -1 and 1.

So, in this case, Subcase 2a gives us four equations:

1. Roots 2 and 2: equation $x^2 - 4x + 4$
2. Roots 2 and -2: equation $x^2 - 0x - 4 = x^2 - 4$
3. Roots -1 and -1: equation $x^2 + 2x + 1$
4. Roots -1 and 1: equation $x^2 + 0x -1 = x^2 - 1$

Wait a second, but hold on, need to remember that these quadratics may have been considered in previous cases. For example, the equation with roots 2 and 2: is that different from the previous case where both roots are fixed points? In the first case, where both roots are fixed points, we had roots 2 and -1. So in this case, the equation with roots 2 and 2 is new. Similarly, roots -1 and -1 is new. So these are four equations from Case 2a.

But wait, also, we need to check if these equations have been counted in previous cases. In the first case, we had the equation with roots 2 and -1. So these are different. Therefore, we have four more equations here.

Subcase 2b: What if the other way around? Suppose that $s$ is a fixed point, and $r^2 - 2 = s$. But isn't this the same as Subcase 2a? Because if $r$ is a fixed point and $s^2 - 2 = r$, then if we consider $s$ being a fixed point, then $s$ would have to satisfy $s^2 - 2 = s$, meaning $s$ is 2 or -1, and then $r^2 - 2 = s$. Which is similar to what we did in Subcase 2a. So maybe Subcase 2a and 2b are actually overlapping? Maybe there isn't a separate case here, since we already considered both possibilities. So perhaps we have covered all possibilities in Subcase 2a.

Case 3: Neither root is a fixed point, but applying the function $f(c) = c^2 - 2$ to each root leads to the other root. That is, $r^2 - 2 = s$ and $s^2 - 2 = r$. So, both roots are mapped to each other under the function $f$. Let me analyze this case.

So, if $r^2 - 2 = s$ and $s^2 - 2 = r$, then we can set up a system of equations. Let me write:

From the first equation: $s = r^2 - 2$

Plugging this into the second equation: $(r^2 - 2)^2 - 2 = r$

Expanding that: $r^4 - 4r^2 + 4 - 2 = r$, so $r^4 - 4r^2 + 2 - r = 0$, which is $r^4 - 4r^2 - r + 2 = 0$

So, we need to solve this quartic equation. Let me see if I can factor it or find rational roots.

Using Rational Root Theorem: possible rational roots are ±1, ±2.

Let me test r = 1: 1 - 4 - 1 + 2 = -2 ≠ 0

r = -1: 1 - 4 + 1 + 2 = 0. Oh, so r = -1 is a root.

So, we can factor out (r + 1). Let me perform polynomial division or use synthetic division.

Divide $r^4 - 4r^2 - r + 2$ by (r + 1).

Using synthetic division for root -1:

Coefficients: 1 (r^4), 0 (r^3), -4 (r^2), -1 (r), 2 (constant)

Bring down the 1

Multiply by -1: -1

Add to next coefficient: 0 + (-1) = -1

Multiply by -1: 1

Add to next coefficient: -4 + 1 = -3

Multiply by -1: 3

Add to next coefficient: -1 + 3 = 2

Multiply by -1: -2

Add to last coefficient: 2 + (-2) = 0. Perfect.

So, the quartic factors as (r + 1)(r^3 - r^2 - 3r + 2). Now, let's factor the cubic: $r^3 - r^2 - 3r + 2$.

Again, using Rational Root Theorem: possible roots are ±1, ±2.

Testing r=1: 1 - 1 - 3 + 2 = -1 ≠ 0

r=2: 8 - 4 - 6 + 2 = 0. So r=2 is a root.

Therefore, factor out (r - 2):

Using synthetic division on r^3 - r^2 - 3r + 2 with root 2:

Coefficients: 1, -1, -3, 2

Bring down 1

Multiply by 2: 2

Add to next coefficient: -1 + 2 = 1

Multiply by 2: 2

Add to next coefficient: -3 + 2 = -1

Multiply by 2: -2

Add to last coefficient: 2 + (-2) = 0

Therefore, the cubic factors as (r - 2)(r^2 + r - 1). Therefore, overall, the quartic factors as:

(r + 1)(r - 2)(r^2 + r - 1)

Therefore, the roots of the quartic equation are:

r = -1, r = 2, and roots of $r^2 + r - 1 = 0$, which are $r = [-1 ± √(1 + 4)] / 2 = [-1 ± √5]/2$.

So, going back, the quartic equation $r^4 - 4r^2 - r + 2 = 0$ has roots -1, 2, and $[-1 ± √5]/2$.

But remember, in this case, we were looking for solutions where $r$ and $s$ satisfy $s = r^2 - 2$ and $r = s^2 - 2$. Therefore, for each root $r$ of the quartic, we can find the corresponding $s$, but we need to check if they form distinct roots or not.

First, take r = -1:

Then s = (-1)^2 - 2 = 1 - 2 = -1. So s = -1, which is the same as r. Therefore, this corresponds to the case where both roots are -1, which we had considered in Case 2a. So that equation is already counted there.

Next, take r = 2:

s = (2)^2 - 2 = 4 - 2 = 2. Again, same as r. So this corresponds to the case where both roots are 2, which was also counted in Case 2a.

Now, take the roots $r = [-1 + √5]/2$ and $r = [-1 - √5]/2$. Let me compute s for each.

Let me denote $r_1 = [-1 + √5]/2$ and $r_2 = [-1 - √5]/2$. Then, compute s = r^2 - 2 for each.

First, compute $r_1^2 - 2$:

Let me compute $r_1^2$:

$([-1 + √5]/2)^2 = [1 - 2√5 + 5]/4 = [6 - 2√5]/4 = [3 - √5]/2.

Therefore, $r_1^2 - 2 = [3 - √5]/2 - 2 = [3 - √5 - 4]/2 = [-1 - √5]/2 = r_2$.

Similarly, for $r_2^2 - 2$:

$([-1 - √5]/2)^2 = [1 + 2√5 + 5]/4 = [6 + 2√5]/4 = [3 + √5]/2.

Then, $r_2^2 - 2 = [3 + √5]/2 - 2 = [3 + √5 - 4]/2 = [-1 + √5]/2 = r_1$.

Therefore, these two roots $r_1$ and $r_2$ satisfy $s = r^2 - 2$ and vice versa. Therefore, the quadratic equation with roots $r_1$ and $r_2$ will satisfy the condition that if c is a root, then $c^2 - 2$ is also a root. Let me confirm that.

Suppose $c = r_1$, then $c^2 - 2 = r_2$, which is another root. Similarly for $c = r_2$, $c^2 - 2 = r_1$. Therefore, this equation satisfies the condition. Therefore, this is another quadratic equation.

So, in Case 3, we get two more equations: one with roots $[-1 + √5]/2$ and $[-1 - √5]/2$, and another one? Wait, no, this is a quadratic equation with these two roots, so only one equation here. Wait, but earlier, in Case 2a, we had equations with roots 2 and -2, and -1 and 1, etc. So, this is a new equation. Let me compute its coefficients.

Let me compute the quadratic equation with roots $r_1$ and $r_2$, where $r_1 + r_2 = [(-1 + √5)/2 + (-1 - √5)/2] = (-2)/2 = -1$. So the sum of roots is -1, so $-a = -1$, so $a = 1$. The product $r_1 r_2$ is equal to [(-1 + √5)/2] * [(-1 - √5)/2] = [(-1)^2 - (√5)^2]/4 = [1 - 5]/4 = (-4)/4 = -1. Therefore, the product is -1, so $b = -1$. Therefore, the equation is $x^2 + ax + b = x^2 + x - 1 = 0$. Wait, hold on: Vieta's formula says that $r + s = -a$ and $rs = b$. Therefore, since $r + s = -1 = -a$, so $a = 1$, and $rs = -1 = b$. Therefore, the equation is $x^2 + x - 1 = 0$. So that's the equation. So that's another equation.

But wait, earlier in Case 2a, we had equations like $x^2 - 1 = 0$, which has roots 1 and -1. Wait, but in this case, we have $x^2 + x - 1 = 0$, which has roots $[-1 ± √5]/2$. So that's different. So this is a new equation.

So in Case 3, we have one equation here. However, we need to check if there are more equations in this case. For example, is there another quadratic equation where applying the transformation swaps the roots? But since we have only two roots, and they are mapped to each other, which gives us one equation. However, note that the quartic had three roots (-1, 2, and the two others). But the ones corresponding to -1 and 2 lead to equations already considered in Case 2a, so only the two irrational roots give us a new equation here.

Wait, but hold on. Let me check if there are other possibilities in Case 3. Suppose that maybe there is another pair of roots that satisfy the condition? But since we solved the equation $r^4 - 4r^2 - r + 2 = 0$ and found all solutions, so we have covered all possibilities.

Therefore, Case 3 gives us one new equation: $x^2 + x - 1 = 0$.

Wait, but hold on, I need to check if there are other cases. For example, maybe there are quadratics where both roots are mapped to each other, but with multiplicities? Wait, but quadratics can't have multiplicities unless they have a double root, but in that case, the equation would be like $(x - r)^2$, so then the root is r, and applying $f(r)$ would need to be r, so that would be Case 1 or 2a. So those are already considered.

Therefore, compiling all the cases:

Case 1: Quadratic with roots 2 and -1: equation $x^2 - x - 2 = 0$.

Case 2a: Quadratic with roots (2, 2), (2, -2), (-1, -1), (-1, 1): equations $x^2 - 4x + 4$, $x^2 - 4$, $x^2 + 2x + 1$, $x^2 - 1$.

Case 3: Quadratic with roots $[-1 ± √5]/2$: equation $x^2 + x - 1 = 0$.

But now, we need to check if there are overlaps between these cases. For example, the equation $x^2 - 1 = 0$ has roots 1 and -1, which was considered in Case 2a. Similarly, equation $x^2 - 4 = 0$ has roots 2 and -2, also considered in Case 2a. The equation $x^2 + 2x + 1 = 0$ is (x + 1)^2, and $x^2 - 4x + 4$ is (x - 2)^2. So these are all separate equations. Case 1 is separate. Case 3 is another separate equation.

So in total, how many equations do we have?

Case 1: 1 equation.

Case 2a: 4 equations.

Case 3: 1 equation.

Total: 1 + 4 + 1 = 6 equations.

But wait, let me verify each of these equations to make sure they satisfy the condition.

First, Case 1: $x^2 - x - 2 = 0$. Roots are 2 and -1. Then, for root 2: $2^2 - 2 = 2$, which is a root. For root -1: $(-1)^2 - 2 = 1 - 2 = -1$, which is a root. So good.

Case 2a equations:

1. $x^2 -4x +4 = 0$: roots 2 and 2. For root 2: 2^2 -2 = 2, which is a root. So yes.

2. $x^2 -4 =0$: roots 2 and -2. For 2: 2^2 -2 = 2, which is a root. For -2: (-2)^2 -2 = 4 -2 = 2, which is a root. So yes.

3. $x^2 + 2x +1 =0$: roots -1 and -1. For -1: (-1)^2 -2 = 1 -2 = -1, which is a root. So yes.

4. $x^2 -1 =0$: roots 1 and -1. For root 1: 1^2 -2 = -1, which is a root. For root -1: (-1)^2 -2 = -1, which is a root. So yes.

Case 3: $x^2 + x -1 =0$. Roots are $[-1 ± √5]/2$. As checked before, if you take either root, applying the function gives the other root. So yes, satisfies the condition.

So that seems 1 + 4 +1 = 6 equations. However, wait, but in Case 3, we only have one equation. Let me check if there are more equations in this case?

Wait, the quartic equation had roots -1, 2, and the two irrational roots. But for roots -1 and 2, they lead to equations already considered in Case 2a. The two irrational roots form a pair which gives the equation in Case 3. Therefore, only one equation here. So total 6 equations.

But wait, let me check if there are other quadratics that might satisfy the condition. For example, suppose there is a quadratic with roots that are not fixed points or swapped, but maybe something else?

Wait, suppose there is a quadratic with three roots? But no, quadratic has only two roots. So, unless there's some overlap or repetition. For example, if a root maps to itself and another root maps to the first root? Wait, but that was considered in Case 2a.

Alternatively, maybe quadratics with complex roots? Wait, the problem didn't specify that the roots have to be real. Hmm, but maybe I need to check that. Wait, but if the equation has complex roots, then applying $c^2 - 2$ might result in other complex numbers. However, the question says "whenever c is a root of the equation, c^2 - 2 is also a root". So even if the roots are complex, as long as the transformation maps roots to other roots, which are also in the set. But in our previous cases, we considered real roots. However, the problem didn't specify whether the roots are real or complex. So maybe there are more equations with complex roots.

Wait, but the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so a and b are presumably real numbers? Wait, the problem doesn't specify, but in Olympiad problems, unless stated otherwise, coefficients are usually real. However, even if they are complex, we can consider them. Let me check if there are equations with complex roots that satisfy the condition.

But in our previous analysis, we considered all roots, real or complex. For example, the equation $x^2 + x -1 = 0$ has real roots. Wait, but the quartic we solved included real roots. However, perhaps there are other equations with complex roots?

Wait, but when we considered Case 3, the roots $[-1 ± √5]/2$ are real. The other roots from the quartic were -1 and 2, real numbers. So, are there complex roots that could satisfy the condition?

Let me think. Suppose that there is a quadratic with complex roots such that if you take a root, apply $c^2 - 2$, you get another root, which may be complex. However, since the coefficients are real (probably), complex roots come in conjugate pairs. Let me suppose that the quadratic has complex roots $p$ and $\overline{p}$. Then, if $p$ is a root, then $p^2 - 2$ must be a root. Since the coefficients are real, $p^2 - 2$ must be either $p$ or $\overline{p}$. Let me consider possibilities.

If $p^2 - 2 = p$, then solving $p^2 - p -2 = 0$, which gives real roots 2 and -1, which we already considered. So, complex roots would require that $p^2 - 2 = \overline{p}$. Let me suppose that $p$ is a complex number such that $p^2 - 2 = \overline{p}$. Let me write $p = a + bi$, then $\overline{p} = a - bi$. Then:

$p^2 = (a + bi)^2 = a^2 - b^2 + 2abi$. Therefore, $p^2 - 2 = (a^2 - b^2 - 2) + 2abi$. Setting this equal to $\overline{p} = a - bi$, so:

Real part: $a^2 - b^2 - 2 = a$

Imaginary part: $2ab = -b$

Let me solve the imaginary part first: $2ab = -b$. If b ≠ 0, then 2a = -1 ⇒ a = -1/2. If b = 0, then p is real, which we already considered.

So, assuming b ≠ 0, then a = -1/2. Then, plugging into real part:

(-1/2)^2 - b^2 - 2 = -1/2 ⇒ 1/4 - b^2 - 2 = -1/2 ⇒ (-b^2) - 7/4 = -1/2 ⇒ -b^2 = -1/2 + 7/4 = 5/4 ⇒ b^2 = -5/4. Which is impossible, since b is real. Therefore, no solutions in this case. Therefore, there are no complex roots (other than real ones) that satisfy the condition.

Therefore, all solutions are covered in the previous cases, and there are no complex quadratics with distinct complex roots that satisfy the condition. Therefore, our previous count of 6 equations is correct.

But wait, let me check once again. Let me list all equations:

Case 1: Roots 2 and -1: equation $x^2 - x - 2 = 0$.

Case 2a:

1. Roots 2 and 2: $x^2 - 4x + 4 = 0$

2. Roots 2 and -2: $x^2 - 4 = 0$

3. Roots -1 and -1: $x^2 + 2x + 1 = 0$

4. Roots -1 and 1: $x^2 - 1 = 0$

Case 3: Roots $[-1 ± √5]/2$: $x^2 + x - 1 = 0$

So total of 1 + 4 + 1 = 6 equations. Therefore, the answer is 6?

Wait, but let me check if there are duplicates. For example, is $x^2 -1 = 0$ considered in Case 2a? Yes, as the roots -1 and 1. And the equation $x^2 + x -1 = 0$ is different from all others. Similarly, the other equations are distinct. So 6 equations.

But let me check for possible other equations. For example, suppose the quadratic has a root c such that applying the function twice brings it back. Wait, but that might be already considered. For example, if c is a root, then c^2 -2 is another root, and then applying the function again, (c^2 -2)^2 -2 should be a root. But since there are only two roots, this would mean that either (c^2 -2)^2 -2 is equal to c or to c^2 - 2.

But in our previous cases, this is already considered. For example, in Case 3, the roots are such that applying the function once swaps them, so applying it twice returns to the original. In Case 1, applying the function leaves it the same. In Case 2a, for roots like 2 and -2, if you take 2, apply the function you get 2, same for -2, applying function gives 2, which is a root. So in that case, applying twice still gives the same thing.

Therefore, all possibilities are covered.

Wait, but hold on. Let me check equation $x^2 - 4x + 4 = 0$, which has a double root at 2. Then, according to the problem statement, whenever c is a root, c^2 -2 is also a root. Since there is only one root, 2, then c^2 -2 is 2, which is the same root, so it's okay. Similarly for other equations with double roots.

So, all 6 equations satisfy the condition. However, I need to make sure that there are no other quadratics. Wait, let me check if maybe the quartic in Case 3 could have more equations. For example, could there be another pair of roots that satisfy the condition?

Wait, the quartic equation was derived from the condition that applying the function twice maps a root to itself. So, the solutions of the quartic are the roots that satisfy this, but in the Case 3, only the two irrational roots lead to a new quadratic equation. The other roots led to equations already considered. Therefore, no other quadratics.

Wait, but what if there is a quadratic with both roots such that applying the function gives a root, but not necessarily the same as the previous? For example, suppose we have a quadratic where one root maps to the other, and that other maps to some other root? But since there are only two roots, the other root must be one of the existing roots. So, this is already covered in Cases 2 and 3.

Therefore, I think the total number of such quadratics is 6. But let me check again for possible mistakes.

Wait, in Case 2a, we had 4 equations. Let me list their equations again:

1. $x^2 - 4x + 4 = 0$ (double root 2)

2. $x^2 - 4 = 0$ (roots 2 and -2)

3. $x^2 + 2x + 1 = 0$ (double root -1)

4. $x^2 - 1 = 0$ (roots -1 and 1)

Case 1: $x^2 - x - 2 = 0$ (roots 2 and -1)

Case 3: $x^2 + x - 1 = 0$ (roots $[-1 ± √5]/2$)

Yes, 6 equations. But let me check if there's another equation that was missed. For example, suppose a quadratic equation with roots 1 and something. Wait, if we take the equation $x^2 - 1 = 0$, which is already considered. Or if there is another equation with roots 1 and something else? Let me check.

Suppose we have a root r and s, where r maps to s and s maps to r, which is Case 3. But we considered that. If there is another pair of roots where r maps to s and s maps to r, but different from Case 3? But the quartic equation we solved was the only possible such pair. Therefore, no.

Alternatively, perhaps equations with roots that are fixed points and something else? But that was covered in Case 2a.

Alternatively, are there equations where one root maps to itself and the other maps to the first root? Which was covered in Case 2a. For example, the equation with roots 2 and -2: 2 maps to itself, and -2 maps to 2. Similarly, equation with roots -1 and 1: -1 maps to itself, and 1 maps to -1. Wait, no. Wait, for equation with roots -1 and 1:

For root -1: (-1)^2 - 2 = 1 - 2 = -1, which is a root. For root 1: (1)^2 - 2 = 1 - 2 = -1, which is a root. Therefore, the root 1 maps to -1, and -1 maps to itself. Therefore, this is similar to Subcase 2a where one root is fixed and the other maps to it. Therefore, covered.

So, I think all possibilities are covered. Hence, total 6 equations.

But let me check again if the equation $x^2 + x -1 = 0$ is indeed valid. Let me take a root of that equation, say $r = [-1 + √5]/2 ≈ (-1 + 2.236)/2 ≈ 0.618$. Then $c^2 - 2 ≈ (0.618)^2 - 2 ≈ 0.618*0.618 ≈ 0.381 - 2 ≈ -1.619$. Which is approximately $[-1 - √5]/2 ≈ (-1 - 2.236)/2 ≈ -1.618$. So that's the other root. So yes, the condition is satisfied. Similarly for the other root. So this equation works.

Similarly, check equation $x^2 - x - 2 = 0$, roots 2 and -1. 2 maps to 2, -1 maps to -1. So that's okay.

So seems okay.

Therefore, unless there's something missing, the total number is 6. However, let me check once again if there are equations with different a and b values. For example, is there an equation like $x^2 + ax + b = 0$ which is not among the six I listed? For example, could there be an equation with roots 2 and something else?

Wait, if the equation has roots 2 and something else, say, root s. Then, according to the condition, s^2 - 2 must be a root. Since roots are 2 and s, then s^2 - 2 must be either 2 or s. So:

Case A: s^2 - 2 = 2 ⇒ s^2 = 4 ⇒ s = ±2. So then equations are:

- s=2: double root 2, equation $x^2 -4x +4$

- s=-2: roots 2 and -2, equation $x^2 -4$

Case B: s^2 - 2 = s ⇒ s^2 - s -2 = 0 ⇒ s = 2 or -1. So:

- s=2: same as above, double root 2.

- s=-1: equation with roots 2 and -1, which is Case 1.

Therefore, all possibilities covered. Similarly for other roots.

Therefore, I think the total number of equations is indeed 6.

Wait, but hold on. Wait, when we had Case 2a, we had equations with roots 2 and -2, and -1 and 1. However, the equation with roots 2 and -2: if we think of the roots, then for each root:

- For 2: 2^2 - 2 = 2, which is a root.

- For -2: (-2)^2 -2 = 4 - 2 = 2, which is a root. Therefore, this works. Similarly for roots -1 and 1:

For -1: (-1)^2 - 2 = -1, which is a root.

For 1: 1^2 - 2 = -1, which is a root. Therefore, works. So these are valid.

Therefore, I think 6 equations are correct. However, let me check the equations:

List of equations:

1. $x^2 - x - 2 = 0$ (roots 2, -1)

2. $x^2 - 4x + 4 = 0$ (roots 2, 2)

3. $x^2 - 4 = 0$ (roots 2, -2)

4. $x^2 + 2x + 1 = 0$ (roots -1, -1)

5. $x^2 - 1 = 0$ (roots 1, -1)

6. $x^2 + x - 1 = 0$ (roots $[-1 ± \sqrt{5}]/2$)

That's six equations. Therefore, the answer should be 6.

But wait, I need to check if equations 1 and 5 are distinct. For equation 1, roots are 2 and -1. For equation 5, roots are $[-1 ± √5]/2$, which are different numbers, so they are different equations. Similarly, others are distinct. So yes, six equations.

Wait, but let me check if there's an equation with roots 2 and -1. But equation 1 is that. Then, equation 5 is different. So no overlaps.

Alternatively, maybe some equations are duplicates? For example, equation 5 is $x^2 + x -1 = 0$, which isn't same as others. So, yes, six equations.

But wait, the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so different a and b. Let me check if any of these equations have same coefficients.

Equation 1: a = -1, b = -2.

Equation 2: a = -4, b = 4.

Equation 3: a = 0, b = -4.

Equation 4: a = 2, b = 1.

Equation 5: a = -1, b = -1? Wait no:

Wait equation 5 is $x^2 - 1 = 0$, so a = 0, b = -1. Wait no:

Wait Vieta's formula: For equation 5, $x^2 - 1 = 0$, so sum of roots is 0, product is -1. Therefore, for equation $x^2 + ax + b = 0$, we have a = 0 and b = -1. So equation 5 is a=0, b=-1.

Equation 1: a = -1, b = -2.

Equation 2: a = -4, b = 4.

Equation 3: a = 0, b = -4.

Equation 4: a = 2, b = 1.

Equation 6: $x^2 + x -1 = 0$, so a = 1, b = -1.

So all equations have distinct (a, b) pairs. Therefore, they are all distinct equations. Therefore, total number is 6.

But let me check once again. For example, is there any other equation? Let me think:

Suppose we have a quadratic with both roots mapping to each other. Wait, we already considered that in Case 3, giving equation 6.

Alternatively, quadratics where both roots are fixed points: equation 1.

Quadratics where one root is fixed and the other maps to it: equations 2, 3, 4, 5.

Hence, 1 + 4 + 1 = 6.

Alternatively, maybe the equation $x^2 + x - 1 = 0$ is the same as another equation? No, different coefficients.

Therefore, I think the answer is 6.

Wait, but let me check if the problem counts equations with different a and b as different even if they have the same roots but different coefficients? No, wait, no. For example, if two equations have same roots, they are same equation. But in our list, equations 2, 4, 5, and 3 are different: equation 2 is double root 2, equation 3 is roots 2 and -2, equation 4 is double root -1, equation 5 is roots -1 and 1. So they are different equations.

So, yes, 6 equations. So I think the answer is 6. However, I recall sometimes in such problems, equations with leading coefficient 1 are considered, but since the problem says "quadratic equations of the form $x^2 + ax + b = 0$", so leading coefficient is 1, so no issues there.

Therefore, I think the final answer is 6. However, I have a doubt because sometimes problems like this might have symmetries or other constraints. Wait, let me check again the quartic equation. The quartic was $r^4 - 4r^2 - r + 2 = 0$, which factors as (r + 1)(r - 2)(r^2 + r - 1). Therefore, the quadratic factor is r^2 + r - 1, leading to equation x^2 + x - 1 = 0. Therefore, only one equation here. So yes, Case 3 gives one equation. So total 1 + 4 + 1 = 6.

Alternatively, maybe I should check if equations with roots that are the same as Case 1 are overlapping? For example, equation 1 has roots 2 and -1. Are there any other equations with roots 2 and -1? No, because the equation is uniquely determined by its roots. So it's only one equation.

Therefore, yes, total number is 6. Therefore, I think the answer is \boxed{6}.

**Final Answer**
\boxed{6}

To determine the number of quadratic equations of the form
$$
x^2 + ax + b = 0
$$
such that **whenever $ c $ is a root of the equation, $ c^2 - 2 $ is also a root**, we proceed systematically by analyzing the problem's structural constraints.

---

### Step 1: Understanding the Root Mapping Condition

Let the **roots of the quadratic** be $ r $ and $ s $. The condition says that **if $ c $ is a root, then $ c^2 - 2 $ is also a root**. Since a quadratic can have at most two roots, this leads to different scenarios:

1. **Case 1: Fixed Points**
   A root $ r $ is a **fixed point** if $ r^2 - 2 = r $. Solving this:

   $$
   r^2 - r - 2 = 0 \Rightarrow (r - 2)(r + 1) = 0 \Rightarrow r = 2 \text{ or } r = -1
   $$

   So, if the roots are $ 2 $ and $ -1 $, then:
   - $ 2^2 - 2 = 2 $, and
   - $ (-1)^2 - 2 = -1 $

   This satisfies the condition. So, the corresponding equation is:

   $$
   (x - 2)(x + 1) = x^2 - x - 2
   $$

   → **Equation (1):** $ x^2 - x - 2 $

2. **Case 2: One Fixed Point, the Other Mapping to the First Root**
   Suppose one root $ r = 2 $ (a fixed point), and the other root $ s $ satisfies:

   $$
   s^2 - 2 = 2 \Rightarrow s^2 = 4 \Rightarrow s = \pm2
   $$

   So, possible pairs are:
   - $ (2, 2) \Rightarrow x^2 - 4x + 4 $
   - $ (2, -2) \Rightarrow x^2 - 4 $

   Similarly, if $ r = -1 $, then the other root $ s $ satisfies:

   $$
   s^2 - 2 = -1 \Rightarrow s^2 = 1 \Rightarrow s = \pm1
   $$

   So, possible pairs are:
   - $ (-1, -1) \Rightarrow x^2 + 2x + 1 $
   - $ (-1, 1) \Rightarrow x^2 - 1 $

   → **Equations (2–5):**
   - $ x^2 - 4x + 4 $ (double root 2)
   - $ x^2 - 4 $ (roots 2 and -2)
   - $ x^2 + 2x + 1 $ (double root -1)
   - $ x^2 - 1 $ (roots -1 and 1)

3. **Case 3: Roots Mapping to Each Other**
   Here, suppose root $ r $ maps to root $ s $, and vice versa, i.e.:

   $$
   r^2 - 2 = s \quad \text{and} \quad s^2 - 2 = r
   $$

   Substituting $ s = r^2 - 2 $ into the second equation yields:

   $$
   (r^2 - 2)^2 - 2 = r \Rightarrow r^4 - 4r^2 - r + 2 = 0
   $$

   Solving this quartic, we factor:

   $$
   (r + 1)(r - 2)(r^2 + r - 1) = 0
   $$

   Roots are $ r = -1 $, $ r = 2 $, and the roots of $ r^2 + r - 1 = 0 $, i.e.,

   $$
   r = \frac{-1 \pm \sqrt{5}}{2}
   $$

   These two irrational roots form a **new quadratic** with sum and product:

   - Sum = $ \frac{-1 + \sqrt{5}}{2} + \frac{-1 - \sqrt{5}}{2} = -1 $
   - Product = $ \frac{(-1+\sqrt{5})(-1-\sqrt{5})}{4} = \frac{1 - 5}{4} = -1 $

   So, the corresponding equation is:

   $$
   x^2 + x - 1
   $$

   This is a new valid equation where the roots are mapped to each other, satisfying the condition.

   → **Equation (6):** $ x^2 + x - 1 $

---

### Step 2: Counting the Distinct Equations

From the above cases, we have:

- **Case 1**: 1 equation
- **Case 2**: 4 equations
- **Case 3**: 1 equation

Thus, the total number of such quadratic equations is:

$$
\boxed{6}
$$

Solution:
Let the roots be $r$ and $s$ (not necessarily real).  We take the cases where $r = s$ and $r \neq s.$

Case 1: $r = s.$

Since $r$ is the only root, we must have $r^2 - 2 = r.$  Then $r^2 - r - 2 = 0,$ which factors as $(r - 2)(r + 1) = 0,$ so $r = 2$ or $r = -1.$  This leads to the quadratics $x^2 - 4x + 4$ and $x^2 + 2x + 1.$

Case 2: $r \neq s.$

Each of $r^2 - 2$ and $s^2 - 2$ must be equal to $r$ or $s.$  We have three cases:

(i) $r^2 - 2 = r$ and $s^2 - 2 = s.$

(ii) $r^2 - 2 = s$ and $s^2 - 2 = r.$

(iii) $r^2 - 2 = s^2 - 2 = r$.

In case (i), as seen from Case $r,$ $s \in \{2,-1\}.$  This leads to the quadratic $(x - 2)(x + 1) = x^2 - x - 2.$

In case (ii), $r^2 - 2 = s$ and $s^2 - 2 = r.$  Subtracting these equations, we get
\[r^2 - s^2 = s - r.\]Then $(r - s)(r + s) = s - r.$  Since $r - s \neq 0,$ we can divide both sides by $r - s,$ to get $r + s = -1.$  Adding the equations $r^2 - 2 = s$ and $s^2 - 2 = r,$ we get
\[r^2 + s^2 - 4 = r + s = -1,\]so $r^2 + s^2 = 3.$  Squaring the equation $r + s = -1,$ we get $r^2 + 2rs + s^2 = 1,$ so $2rs = -2,$ or $rs = -1.$  Thus, $r$ and $s$ are the roots of $x^2 + x - 1.$

In case (iii), $r^2 - 2 = s^2 - 2 = r.$  Then $r^2 - r - 2 = 0,$ so $r = 2$ or $r = -1.$

If $r = 2,$ then $s^2 = 4,$ so $s = -2.$  (We are assuming that $r \neq s.$)  This leads to the quadratic $(x - 2)(x + 2) = x^2 - 4.$

If $r = -1$, then $s^2 = 1,$ so $s = 1.$  This leads to the quadratic $(x + 1)(x - 1) = x^2 - 1.$

Thus, there are $\boxed{6}$ quadratic equations that work, namely $x^2 - 4x + 4,$ $x^2 + 2x + 1,$ $x^2 - x - 2,$ $x^2 + x - 1,$ $x^2 - 4,$ and $x^2 - 1.$