Yes this is basically the correct approach. Strictly speaking some of the energy you put in will go into heating the water - the water will get hotter as you agitate it. So the energy balance would be something like:

$$ \Delta E = W + C\Delta T $$

where $C$ is the specific heat and $\Delta T$ the temperature rise. However under most conditions the temperature rise will be small enough that it can be ignored.