Trouble with minimum surface area for a cylinder

I was reading through my notes and I was kinda like stumbled in the way the minimum surface area of a cylinder has been derived.

First,

A= 2*PI*r^2 + 2*PI*r*h

and given the condition that the volume has been fixed, the resulting area equation becomes

A= 2*PI*r^2 + 2V/r since V = PI*r^2*h

Taking the first derivative of A,

A' = 4*PI*r - 2V/r^2

Letting A' = 0 and solving for h will give us h = 2r.

Everything seems nice and well defined. However, I have some confusion in my head.

In the first place why can't we take the derivative of the first area equation directly (A= 2*PI*r^2 + 2*PI*r*h) and fixing h to be like a constant? I tried doing it and i got h = -2r? The negative sign simply indicates that it's not right.. I'm puzzled..?

And also,since volume is also a function of both 'r' and 'h', it doesn't really make sense to fix volume as a constant. I just find it weird. I mean we can fix 'h' for the volume but 'r' is still in it which in fact causes the volume to vary still. So how in the first place can we fix the volume with 'r', a variable being in it the first plcae?

Gosh, Hope I'm sounding right. I look foward to valuable inputs from all of you.

In the first place why can't we take the derivative of the first area equation directly (A= 2*PI*r^2 + 2*PI*r*h) and fixing h to be like a constant? I tried doing it and i got h = -2r? The negative sign simply indicates that it's not right.. I'm puzzled..?

Because you have to vary r and h at the same time (because they're connected - increase one, it automatically decreases the other).

But you can't differentiate with respect to both, so you eliminate one of them (either h or r - try it with r instead, just for practice!) by expressing in terms of the other and V.

Since V is a constant, you now have only one variable, and you can go ahead.

And also,since volume is also a function of both 'r' and 'h', it doesn't really make sense to fix volume as a constant. I just find it weird. I mean we can fix 'h' for the volume but 'r' is still in it which in fact causes the volume to vary still. So how in the first place can we fix the volume with 'r', a variable being in it the first plcae?

As a matter of "natural justice", yes, there's nothing to choose between r h and V - they're all variables.

But we can make anything a constant - in this example, we've chosen V.