What you can do for this case is to write the following equations by using the Pythagorean theorem:
y ^ 2 = 3 ^ 2 + x ^ 2
(4 + x) ^ 2 = 5 ^ 2 + y ^ 2
We observe that we have two equations with two unknowns.
You can use any method to solve it, obtaining the following results:
x = 9/4
y = 15/4
Answer:
the values of x and y are
x = 9/4
y = 15/4