A right angled triangle at any given x will connect x, y, and r to the origin. This is because it will follow the Pythagorean theorem as follows:
r2 = x2 + y2
Thus, when you substitute y with the function of x you get:
V = x = 0∫x = r π (r2 - x2) dx
Therefore,
V = π ( r3 - r3/ 3) = 2/3 πr3