You
can't "by means of integration! You
can "by means of differentiation". Putting h= 6- r in

gives

. The derivative of that is

. The maximum possible volume is given by the (non-zero) r value that makes that 0.
(neither r nor h can be negative which mean r cannot be less than 0 or greater than 6. Technically we should consider the endpoints 0 and 6 but those obviously give minimum volume (a flat disk or a straight line).