Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can somebody fill me in on a visual explanation for the following:

If there exist integers $x, y$ such that $x^2 + y^2 = c$, then there also exist integers $w, z$ such that $w^2 + z^2 = 2c$

I know why it is true (ex. take $w = x-y, z = x+y$), but I would think there is a visual explanation hiding somewhere because of squared terms (we can make squares!!)

share|cite|improve this question
up vote 26 down vote accepted

It will take me forever to post the diagram so here is a description.

Draw the circle with centre $(0,0)$ and radius $\sqrt c\,$. Locate the point $(x,y)$ on this circle: by assumption, $x$ and $y$ are integers. Draw the tangent to this circle starting at $(x,y)$ and having length $\sqrt c\,$. This will give a point distant $\sqrt{2c}$ from the origin (because we have a right angled isosceles triangle), and the point will have integer coordinates because it is obtained from $(x,y)$ by a displacement of $(y,-x)$ or $(-y,x)$, depending which way we drew the tangent.

Update: see another answer for the picture. Thanks Oleg!

share|cite|improve this answer
Doubt: How did you calculate the displacement? – Anant Mar 20 '14 at 17:17
The line perpendicular to a point $(x, y)$ has a slope of $\frac{-x}{y}$. So, a displacement of $(-y, x)$ or $(y, -x)$ is contained by that perpendicular and is the same length as the original displacement from the origin of $(x, y)$ – Michael Tong Mar 20 '14 at 19:19
Or more simply: the tangent is perpendicular to the radius, so the $x$ coordinate becomes the $y$ coordinate and vice versa, with a little care to get the signs right. – David Mar 20 '14 at 21:01

2 Circles


share|cite|improve this answer
$\sqrt{c}$ is the radius of smaller circle; $\sqrt{2c}$ is the radius of bigger circle; $(\sqrt{c})^2+(\sqrt{c})^2=(\sqrt{2c})^2$ (triangle is $45^\circ$ right triangle). – Oleg567 Mar 20 '14 at 12:05
source ( code)? – user13107 Mar 20 '14 at 16:05
@Oleg567 What if $c$ isn't an integer? – Jack M Mar 20 '14 at 18:07
@JackM That's impossible, since x and y are integers. – Red Alert Mar 20 '14 at 18:34
@user13107: earlier [rough] image was made via MS Word (to draw circle, line, show Grid :); last [accurate] image was made via C/C++ (Windows API, GDI-functions: MoveToEx(), LineTo, Ellipse(), ...). – Oleg567 Mar 21 '14 at 10:59

Hint $\ $ The transformation is simply multiplication by $\, 1+i\,$ in the complex plane

$$(1+i)(x+yi)\, =\, x\!-\!y + (x\!+\!y)i $$

Thus if $\ |x+yi| = x^2+y^2 = c \ $ then

$$ (x\!-\!y)^2+(x\!+\!y)^2 =\, |x\!-\!y+(x\!+\!y)i| = |(1+i)(x+yi)|\, =\, 2\,|x+yi|\,=\,2c$$

Geometrically, multiplication by $\ 1+i = \sqrt{2}\, e^{\large i\pi/4}\,$ may be visualized as an expansion by the factor $\,\sqrt{2}\,$ composed with a rotation by $\,\pi/4.\,$ Let's visualize this in the diagram from Oleg567's answer, excerpted below. Let $\,\rm\color{#c00}{v = x+y\, i}\,$ be the lower red vector. Multiplying it by $\,1+i\,$ yields $\, (1+i){\rm v = v} + i\rm v,\,$ where $\,\rm\color{#c00}{i\,v = -y + x\, i}\,$ is the rotation of $\,\rm v\,$ by $\,\pi/4.\,$ Adding these red vectors yields the result $\,\rm\color{blue}{v + i\, v = x-y + (x+y)\,i}.$

$\qquad\quad$ enter image description here

share|cite|improve this answer
This is very nice. Always appreciate when complex numbers are used in clever ways like this. – Michael Tong Mar 21 '14 at 19:10
Reminded me of this explanation, which opened my eyes to the beauty of complex numbers :) – Anant Mar 22 '14 at 8:25

In terms of the areas of squares:

enter image description here

Edit: Thanks to Michael T for pointing out a simpler rearrangement.

share|cite|improve this answer
Hey, squares! This was the original idea I had in mind. Looks very nice, thank you. – Michael Tong Mar 21 '14 at 19:59
I have found what I believe is a simpler construction (and have thus answered my own question) – Michael Tong Mar 21 '14 at 21:52
@user92774 I've edited the diagram to incorporate your construction. Thanks! – Anant Mar 21 '14 at 22:51

I have devised what I believe to be a simpler construction of Anant's squares argument and have thus shared it here:


share|cite|improve this answer
Very nice! Silly that I didn't spot it :) – Anant Mar 21 '14 at 22:26

If you imagine an integer-sized coordinate grid (as in Oleg567's answer) overlaid with another coordinate grid that has been shrunk by a factor of $\sqrt2$ and rotated by $45^{\circ}$ about the origin, the original unit vectors still have integer coordinates.

So the point $(x,y)$ also has integer coordinates in the new system, being a linear combination of unit vectors. Its distance to the origin is now $\sqrt2$ times the old distance, because we did shrink the unit vectors.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.