arctan x + arctan(1/x) = pi/2

the way the book did it was weird, it substituted or allowed y to be equal arctan x + arctan (1/x) after manipulating the numbers it solved that y is undefined and therefore the function is true?? i know there is an easier and more logical way to do this problem. arctan x = y so tan y = x and if arctan (1/x) = y then tan y = 1/x, i jus dont see how adding those two parts will give me pi/2? any hints, pointers, advice? thanks in advance...