# If $a,b,c$ are positive integers, with $a^2+b^2-ab=c^2$ prove that $(a-b)(b-c)\le0$.

I have an inequality problem which is as follow:

If $a,b,c$ are positive integers, with $a^2+b^2-ab=c^2$ prove that $(a-b)(b-c)\le0$.

I am not so good in inequalities. So, please give me some hints so that I can proceed.

Thanks.

• It's also true when $a,b,c$ are positive real numbers, not integers Sep 16 '17 at 17:06
• Sep 16 '17 at 17:07

It is a nice example of how an algebraic inequality can be transformed into geometric inequality.

Since $$c^2=a^2+b^2-ab\implies c^2=a^2+b^2-2ab \cos60$$

We can think that $a,b,c$ are lengths of sides of a triangle such that the measure of the angle opposed to the side of length $c$ is 60 degrees.

The angles of the triangle $ABC$ satisfy $\angle A\ge60, \angle B\le60$ or $\angle B\ge60, \angle A\le60$.

Hence using the property (In a triangle, the longest side is opposite to greatest angle), we can say that $a\ge c \ge b$ or $a\le c \le b$.

In any case, it follows that $(a-b)(b-c)\le 0$.

• Oh nice, never would've thought of that. Dec 30 '16 at 15:23
• Thanks @SimpleArt, I know you are lying Dec 30 '16 at 15:27
• @THELONEWOLF. Nice answer. +1 Dec 30 '16 at 16:11

The expression $a^2 + b^2 - ab = c^2$ is equivalent to $$a^2 + b^2 - ab = c^2 \longleftrightarrow a^2 - ab = c^2 - b^2 \longleftrightarrow a(a - b) = (c - b)(c + b)$$ Now we multiply by $b - c$ both sides (if $b - c = 0$ then there is nothing to prove): $$a(a - b)(b - c) = (c - b)(c + b)(b - c) = -(c - b)^2 (c + b)$$ The right side is negative, because $-(c - b)^2 \leq 0 \$ (a square is always positive) and $c,b \geq 0 \rightarrow c + b \geq 0$. Then we deduce $$a(a - b)(b - c) \leq 0$$ And we know that $a \geq 0$, so $$(a - b)(b - c) \leq 0$$

We have $a^2+b^2-ab=c^2$, then $(a-b)^2=c^2-ab\ge 0$. So $c^2\ge ab$. This implies that at least one of $c\ge a$ or $c\ge b$ is true.

First case: $c\ge a$. Then $b^2-ab=b (b-a)=c^2-a^2\ge 0$, so $b\ge a$. Thus we have $b^2-c^2=ab-a^2=a (b-a)\ge 0$, so $b\ge c$. Therefore $(a-b)(b-c)\le 0$.

Second case: $c\ge b$. Then $a^2-ab=a (a-b)=c^2-b^2\ge 0$, so $a\ge b$. Hence $(a-b)(b-c)\le 0$.

• nice approach, +1 Dec 30 '16 at 14:45

We need to prove that $$(a-b)\left(b-\sqrt{a^2+b^2-ab}\right)\leq0$$ or $$\frac{-a(a-b)^2}{b+\sqrt{a^2+b^2-ab}}\leq0$$ and we are done!

The condition is $$b^2+a(a-b)=c^2.$$ Now:

$\quad\bullet\quad$ If $a\geq b$ then $c^2\geq b^2\implies c\geq b$.

$\quad\bullet\quad$ If $a\leq b$ then $c^2\leq b^2\implies c\leq b$.

In both cases the result follows.

From given equality we have $c=\sqrt {a^2+b^2-ab}$, then you can plug this in your inequality and you get $(a-b)(b-\sqrt{a^2+b^2-ab})$, now you have 2 cases to look at:

First: $a>b, a=b+x$ with this your first term is positive, so we have to show second one is negative, thus we have $b-\sqrt{b^2+bx+x^2};\sqrt{b^2+bx+x^2} > \sqrt {b^2}$, it is obvious from here that the product is negative.

Second: $a<b,a=b-x$, now we know that first term is negative, so we have to show that second one is positive, again we plug in and get $b-\sqrt{b^2-bx-x^2};\sqrt{b^2-bx-x^2} < \sqrt {b^2}$, so we know that this one is positive, so the product is again negative.

And finally if $a=b$ then their product is $0$ because $a-b=0$.