If you have a fraction where the denominator is a surd, such as 5/(1+sqrt(2)), you need to multiply the denominator by another number so that it becomes a a whole number. If you multiply either the denominator by another number, this changes the value of the fraction. Therefore, we need to multiply the numerator by the same number that we are multiplying the denominator by. This is the same as multiplying the whole fraction by 1 so it does not change the value of the fraction. For example, if we multiplied the numerator by 5 and the denominator by 5, this would be multiplying the fraction by 5/5=1. When we have a denominator of this form m+sqrt(n), we need to multiply the numerator and denominator by m-sqrt(n) so that sqrt(n) cancels out and we are left with a whole number. e.g. 5/(1+sqrt(2)) * ( (1-sqrt(2))/(1-sqrt(2)) ) = (5- 5sqrt(2)) / (1 -sqrt(2) +sqrt(2) -2) = (5-5sqrt(2)) / (-1) = 5sqrt(2) -5
Note that the denominator became a whole number (-1) but we can cancel this down by multiplying the numerator and denominator by -1. We now have 1 as a denominator which means that the fraction just becomes the number from the numerator as dividing by 1 does not change a number.