I have to solve for side B of a right triangle. Side A is the square root of (25-x^2) and the hypotenuse is 5.

when i do A^2 + B^2 = C^2 then at the end i end up with
b^2 = -x^2 but the square root of a negative number is not possible so what am i doing wrong?

You are given:

a = sqrt(25-x^2)
c = 5

So, a^2 + b^2 = c^2
25-x^2 + b^2 = 25
b^2 = x^2
b = x