# Find all $a, b \in \mathbb R$, ($b\ne0)$, such that the roots of $x^2+ax+a=b$ and $x^2+ax+a=-b$ are 4 consecutive numbers

Find all $$a, b \in \Bbb R$$, ($$b\ne0)$$, such that the roots of $$x^2+ax+a=b$$ $$x^2+ax+a=-b$$ are 4 consecutive numbers.

We have: $$x^2+ax+a-b=0$$ $$x^2+ax+a+b=0$$ $$x_1, x_2$$ - roots of first equation; $$x_3, x_4$$ - roots of second equation.

By logic I wrote: $$x_2 (Is there a way to prove this?)

Using Vieta's formulas: $$x_1+x_2+x_3+x_4=2a$$ and because they are consecutive numbers we have $$x=\frac{a-3}2$$

$$\frac{a-3}2=x_2<\frac{a-1}2=x_4<\frac{a+1}2=x_3<\frac{a+3}2=x_1$$

Using Vieta's formulas again: $$\frac{a^2-9}4=a-b,\quad \frac{a^2-1}4=a+b$$

$$\implies b=-1$$ $$\implies a_{1/2}=2\pm\frac{\sqrt{58}}2,\quad a_3=5,\quad a_4=-1$$

My question is are these all the solutions? Or are there more?

• You need to try the other products. Try $x_2\cdot x_4$ for example. – Don Thousand Dec 4 '18 at 17:40
• Although you already received answers, I think your question should be clarified: (1) 4 consecutive numbers: Do you mean integers ´$n, n+1, n+2, n+3$? (2) What are the $x_i$? Certainly the solutions of the two equations, but which $x_i$ of which equation? (3) Typo: $x = ...$. – Paul Frost Dec 4 '18 at 18:21
• I edited for $x_i$. Can consecutive numbers not be integers? (I got confused) @PaulFrost – Pero Dec 4 '18 at 18:27
• I do not think so, but in your comment to Math Lover' s answer ending with "In that case, $a$ and $b$ must be integers" you said "$a,b$ can be real numbers". This confused me. Perhaps you edit once more and write "4 consecutive integers". – Paul Frost Dec 4 '18 at 18:35
• The problem / task says: $a, b \in \Bbb R$, ... the roots of the equations are 4 consecutive numbers. I guess what Math Lover was saying is that the roots won't be integers if $a, b$ are not integers. – Pero Dec 4 '18 at 18:38

You made a mistake while solving $$b$$. Specifically, $$b=1$$. As such, $$a^2-4a-5 = (a-5)(a+1)=0 \implies a = -1,5.$$

Regarding $$x_2 < x_4 < x_3 < x_1$$, you could argue by using the following argument.

Note that one of the roots is the minimum among them. Say that is $$x_2$$. Since $$x_1 + x_2 = a = x_3 + x_4,$$ we have $$x_1 = x_3 + (x_4 - x_2) \implies x_1 > x_3$$ because $$x_4 > x_2$$. Likewise, $$x_1 > x_4$$.

You are looking for integer solutions. In that case, $$a$$ and $$b$$ must be integers

• $a, b$ can be real numbers. – Pero Dec 4 '18 at 18:05
• Oh wait $a, b \in \Bbb R$, but because they are consecutive they must be integers right? – Pero Dec 4 '18 at 18:28
• The $x_i$ are integers, hence by Vieta's formulas $a, b$ must be integers. – Paul Frost Dec 4 '18 at 18:39

Let four integer roots be $$n-1,n,n+1,n+2$$. Write $$(x^2+ax+a-b)(x^2+ax+a+b)=(x-n+1)(x-n)(x-n-1)(x-n-2).$$ or $$x^4+2ax^3+(a^2+2a)x^2+2a^2x+(a^2-b^2)=x^4-2(2n+1)x^3+(6n^2+6n-1)x^2-2(2n^3+3n^2-n-1)x+(n^4+2n^3-n^2-2n). \tag{1}$$ Comparing the coefficients of $$x^3$$ and $$x^2$$ and the constants of (1) gives $$2a=-2(2n+1), a^2+2a=6n^2+6n-1, a^2-b^2=n^4+2n^3-n^2-2n.$$ From these equations, one can solve $$a=-1,b=\pm1,n=0,\text{ or } a=5,,b=\pm1,n=-3.$$

As pointed out by Math Lover, you made a mistake in your computations. The correct solutions for $$a, b$$ are $$a = -1,5$$ and $$b = 1$$. But if you look at xpaul's answer, there are two more solutions $$a = -1,5$$ and $$b = -1$$. Where do they come from?

Observe that neccessarily $$b \ne 0$$, otherwise we would not obtain 4 solutions. But if we get 4 solutions for some $$b$$, we get the same solutions if we replace $$b$$ by $$-b$$ (this replacement is equivalent to permuting the two equations). That explains the occurrence of $$a = -1,5$$ and $$b = -1$$. But why didn't you find them?

This comes from your ordering assumption $$x_2 < x_4 < x_1 < x_3$$. We have $$x_{1/2} = -\frac{1}{2}a \pm \frac{1}{2}\sqrt{a^2 - 4a + 4b}$$, $$x_{3/4} = -\frac{1}{2}a \pm \frac{1}{2}\sqrt{a^2 - 4a - 4b}$$. Now let us assume $$b > 0$$. Then we see that $$x_2 < x_4 < -\frac{1}{2}a < x_3 < x_1$$. It also shows that your ordering is not correct, although it does not matter for your further computations. If we assume $$b < 0$$, we get $$x_4 < x_2 < x_1 < x_3$$ which leads to the "missing" solutions for $$a, b$$.

Finally note that $$a = -1$$ and $$b = \pm1$$ yield the 4 solutions $$-1,0,1,2$$ and $$a = 5$$ and $$b = \pm1$$ yield $$-4,-3,-2,-1$$.