Since a right triangle obviously has a right angle of 90 degrees and it's given that another angle is 45 degrees, the third angle is 180-90-45 = 45 degrees as well. From geometry, those two angles corresponding sides are the same length since their angle measures are the same, so x = 2sqrt(5). Using the Pythagorean Theorem, You have:
[2sqrt(5)]2 + [2sqrt(5)]2 = R2 [Pythagorean Theorem]
4*5 + 4*5 = R2 [Square both terms]
20 + 20 = R2 [Simplify...]
40 = R2 [Simplify...]
R = sqrt(40) [Square root of both sides, keep the positive root only because we are dealing with distances, which can only be positive)
R = 2sqrt(10) [Simplifying radicals]
Or, another way is to know that a 45-45-90 triangle has the two legs equal to each other, so x = 2sqrt(5), and the hypotenuse is sqrt(2) times one of the legs. So R = 2sqrt(5)*sqrt(2) = 2sqrt(10), just like I got above.