# Proving $\sqrt{2}$ is irrational: why $q = p - \frac{p^2 -2}{p+2}$ [duplicate]

I've just begun self-studying Rubin's Principals of Mathematical Analysis.

I'm having difficulty understanding a specific line in example 1.1 (proving $\sqrt{2}$ is irrational). Specifically, I'm trying to understand how they arrive at the following:

$q = p - \frac{p^2 -2}{p+2}$

Here is the proof up to that point:

Let A be the set of all positive rationals p such that $p^2 < 2$ and let B consist of all positive rationals p such that $p^2 > 2$. We shall show that A contains no largest number and B contains no smallest number.

More explicitly, for every p in A we can find a rational q in A such that $p < q$, and for every p in B we can find a rational q in B such that $q < p$.

Any help would be much appreciated.

## marked as duplicate by Daniel W. Farlow, Bill Dubuque elementary-number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 24 '16 at 3:37

• This is how Rudin defines $q$. – Alex Provost Jul 24 '16 at 3:21
• I apologize. I am editing the original question. – statsguyz Jul 24 '16 at 3:21
• The classic proof from the time of Pythagoras goes like: Suppose $\sqrt{2}=\frac{p}{q}$ is rational where $\frac{p}{q}$ is in simplest form, i.e. $\gcd(p,q)=1$. Then by squaring each side, $2q^2=p^2$ and $p^2$ is even, thus $p$ is even, lets call it $2k$. Then $2q^2=4k^2$ and $q^2=2k^2$ so $q^2$ is even, implying $q$ is also even. This is a contradiction however as we desired $\gcd(p,q)=1$ but this would imply that $2$ is a common divisor of $p$ and $q$, hence $\gcd(p,q)\neq 1$. This implies that our mistaken assumption was that $\sqrt{2}$ could have been written as a rational number. – JMoravitz Jul 24 '16 at 3:22
• Rudin defines $q$ like that. He didn't arrive at the assertion. Remember, there are relations like $p<q$ for $A$ and $p>q$ for $B$ – Kushal Bhuyan Jul 24 '16 at 3:26
• Thanks for the input, I updated my original post. – statsguyz Jul 24 '16 at 3:27

Students are baffled by this ‘‘rabbit-out-of-a-hat’’ definition. One should motivate it, or tell the class, ‘‘Take it for granted, without worrying about where it comes from’’ – or something! I generally partially motivate it, noting that if $p^2 < 2$ we want to increase $p$ slightly, while if $p^2 > 2$ we want to decrease it, so the amount we should change it by should be obtained from $p^2 – 2$. A denominator is needed to prevent overshooting, especially when $p$ is large, so we use one that grows with p, but I said the actual choice of denominator $p+2$ can be regarded as the result of trial and error. For a lengthier but more satisfying motivation, see the exercise packet, exercise 1.1:1...