x + 1/x = 5 multiply through by x
x^2 + 1 = 5x subtract 5x from both sides
x^2 - 5x + 1 = 0 subtract 1 from both sides
x^2 -5x = -1 take 1/2 of 5 = 5/2, square it = 25/4 and add this to both sides
x^2 - 5x + 25/4 = -1 + 25/4 factor the left side, simplify the right
(x - 5/2)^2 = 21/4 take pos/neg roots
x - 5/2 = ± √ (21/4) add 5/2 to both sides, simplify the right
x = ± √(21) / 2 + 5/2
x = [ 5 ± √21 ] / 2