46

I recently encountered a Stack Overflow question (since closed) in which the OP was testing for whether a triangle was right by whether or not it "met" the criteria of the Pythagorean Theorem (i.e. whether or not the square of the hypotenuse is equal to the square of the two sides). The code was to this effect:

public void Test(int a, int b, int c) {
   if ((c * c) == ((a * a) + (b * b)) {
     System.out.println("This is a right triangle");
   }
   else {
     System.out.println("This is not a right triangle");
   }
}

(There are obviously some other problems with this code, like the fact that it doesn't validate the input to make sure that the inputs are positive and the fact that it only accepts integers).

The question was asking about something completely different in the code and never directly addressed the test, but I got to thinking: is this a valid test for whether a triangle is a right triangle?

Obviously, the Pythagorean Theorem states that, for all right triangles, $a^2 + b^2 = c^2$ (where $a$ and $b$ are sides and $c$ is the hypotenuse). This will hold for all right triangles, so being a right triangle is a sufficient condition for the Pythagorean Theorem to hold.

Is it also a necessary condition? I.e. if $c^2 = a^2 + b^2$ for some arbitrary triangle, is the triangle necessarily a right triangle? Or are there counterexamples?

7 Answers7

93

Suppose that $a^2 + b^2 = c^2$ is a necessary condition to be a right triangle.

Corollary: $a^2 + b^2 = c^2$ is a sufficient condition to be a right triangle.

Proof: Suppose you're given a particular triangle whose side lengths satisfy $a^2 + b^2 = c^2$.

Construct a right triangle whose two sides adjacent to the angle are of length $a$ and $b$ (e.g. start with the right angle, and mark off the two sides to have the appropriate length). By the supposition, it follows that the third side of the right triangle has length $c$.

By the side-side-side congruence theorem, the original triangle is congruent to the right triangle, and thus the original triangle is a right triangle.

  • 13
    I like this answer the best because it uses the lowest level of mathematics of all of the answers currently offered, and is thus understandable by the widest audience. – Dan Henderson Jul 04 '17 at 17:51
  • This is both simpler and clearer than the accepted answer. Also depends on less stuff. – Jeffrey Jul 05 '17 at 18:33
  • Earlier I wrote a question about this type of proof: https://math.stackexchange.com/q/1500691/101420. More answers are still welcome! – Vincent Jul 05 '17 at 21:53
  • 2
    This assumes it is possible to construct such a triangle. It may not be. For example $a=b=c=0$ satisfies $a^2 + b^2 = c^2$. But that is not a right triangle and if you attempt to use this proof, you will get stuck at the construction step. Similar for negative values, and who knows, absent a proof, maybe for some positive values too. – David Schwartz Jul 06 '17 at 01:24
  • 6
    @DavidSchwartz: The implication is vacuously true for triangles with side lengths impossible for a triangle to have (and as an aside, I imagine the proof would work as is for zero and negative values anyways, if we generalized appropriately to triangles with oriented or degenerate edges). Also, I am content to assume both that the setting is Euclidean geometry and that the reader is familiar with its most basic notions: I am already of the opinion the parenthetical is borderline too much detail, and showing how to cite the congruence and incidence axioms is way beyond the scope of this post. –  Jul 06 '17 at 01:51
81

Yep, the converse of the Pythagorean Theorem is also true. It can be proved using the law of cosines:

Assume $a,b,c$ are the sides of a triangle and they satisfy $a^2 + b^2 = c^2$. Let $\angle ACB = \gamma$. By the law of cosines,

$$ c^2 = a^2 + b^2 - 2ab\cos\gamma . $$

Since $a,b > 0$, we must have $\cos\gamma = 0$. Since $0 < \gamma < 180^\circ$, we must have $\gamma = 90^\circ$. So $\Delta ABC$ is a right triangle.

aras
  • 5,757
  • 14
    This nicely demonstrates that the Pythagorean Theorem is merely a special case of the law of cosines, when $\gamma = 90^\circ$, and the whole $2ab\cos\gamma$ term works out to $0$ – Alexander Jul 05 '17 at 01:04
  • 6
    Isn't all of trigonometry already dependent on the Pythagorean inverse, making this answer a begging the question solution. Pulling the Law of Cosines out of the hat for this is a real proof smell to me – Pieter Geerkens Jul 06 '17 at 08:48
14

The Pythagorean theorem gives a necessary and sufficient characterization of being a right triangle. In other words, when $a$, $b$, and $c$ are the side lengths of a triangle, $a^2 + b^2 = c^2$ is equivalent to the angle opposite the $c$-side being a right angle. This follows from the law of cosines, which states

$$ c^2 = a^2 + b^2 - 2 ab \cos C $$

where $C$ is the angle opposite the $c$-side, for any triangle with side lengths $a$, $b$, and $c$. We only get $c^2 = a^2 + b^2$ when $\cos C = 0$, or when $C = 90^{\circ}$.

It is also interesting to note that this theorem (both the necessary and sufficient parts) are proved in Euclid's Elements via geometric methods.

TonyK
  • 68,059
Bob Krueger
  • 6,619
7

The law of cosines states that $$ c^2=a^2+b^2-2ab\cos(C), $$ where $C$ is the angle opposite the side of length $c$. When does $\cos(C)=0$?

TomGrubb
  • 13,177
6

Let $ABC$ be a non-degenerate triangle with side lengths fulfilling $BC^2+AC^2=AB^2$. Let $\ell$ be the line perpendicular to $BC$ and going through $C$. Let $A'$ and $A''$ be the two distinct points where the circle around $C$ of radius $AC$ intersects $\ell$. Then $A'BC$ and $A''BC$ are right triangles. By Pythagoras, $A'B^2=BC^2+A'C^2=BC^2+AC^2=AB^2$ and likewise $A''B^2=AB^2$. This means that the circle around $B$ of radius $AB$ and the circle around $C$ of radius $AC$ intersect in $A$, $A'$, and $A''$. As there are in fact only two points of intersection and as certainly $A'\ne A''$, we conclude that $A=A'$ or $A=A''$. In both cases, $ABC$ is a right triangle.

5

Yes, and this goes back to Euclid. Euclid I.47 is "In right-angled triangles the square on the side opposite the right angle equals the sum of the squares on the sides containing the right angle." Euclid I.48 is the converse, "If in a triangle the square on one of the sides equals the sum of the squares on the remaining two sides of the triangle, then the angle contained by the remaining two sides of the triangle is right."

Michael Lugo
  • 24,422
0

As other answers have pointed out, this is indeed correct. Although you could nitpick that it isn't correct outside of Euclidean geometry. That is, you could have "right triangles" on a sphere or other non-planar surfaces where the Pythagorean theorem wouldn't hold, and some non-right triangles where it does.

I wonder whether it would still hold true in non-Euclidean geometry if you additionally impose the sum of angles to be 180 degrees.