To find potential energy in 3 dimensions why do we take partial derivative and not total derivative?
Which formula do you mean?
Derivatives of what?
Guessing at the context...
If you have the potential field (e.g. gravitational potential per unit mass as a function of position), you can take three partial derivatives to arrive at the associated vector field (e.g. gravitational acceleration as a function of position).
If you have the vector field (e.g. gravitational acceleration as a function of position) and an assurance that the field is conservative then you can arbitrarily assign a zero potential somewhere, and take a path integral along an arbitrarily chosen path to obtain the associated potential field (e.g. gravitational potential per unit mass as a function of position).
What would it mean to take the total derivative of a function of three variables? The only way I see to do it would be to choose a path (or at least a tangent to a path). Taking a partial derivative amounts to picking a tangent that is aligned with a chosen coordinate axis.
Separate names with a comma.