from the figure we can express as Pythagoras theorem for rectangle triangles:
a^2 = r^2 + z^2
b^2 = r^2 + z^2
sen m = z/a
cos m = r/a
hence by the law of sines and cosines:
sen^2 m + cos^2 m = 1
(z/a)^2 + (r/a)^2 = 1
z^2/a^2 + r^2/a^2 = 1
substitue first equation value for a^2
z^2/(r^2 + z^2) + r^2/(r^2 + z^2) = 1
which proves that in fact is a triangle rectangle due to Pythagoras and sine-cosine laws, the same procedure can be follow for the other rectangle triangule in teh figure.