So when you plug in the numbers it would be x^2+22^2=38^2. Move 22^2 to the right side giving you x^2=38^2-22^2. Then subtract and take the square root of x^2.
The commutative property of addition means we can add two integers in any order. So yes, It would still apply to two negative integers (for example, -2 + -3 and -3 + -2 both equal five)