On desktop and consoles this is basically free. Very little performance difference if any between using the basic sampling method (tex2D() / tex.Sample() / sample node / whatever) vs a derivative form.
On mobile there may be a significant cost. On some mobile GPUs it appears to cause some problems related to memory bandwidth that do not occur normally. It was explained to me that in using manual derivatives, each pixel’s texture sample is invalidating the local texture unit’s cache causing it to re-fetch from the next tier. I don’t believe this is true for all mobile GPUs, but it’s enough of them that the mobile focused shader / graphics devs I know will make efforts to avoid using it when unnecessary.
Basically if you’re already in a highly memory bandwidth limited situation (you have a lot of different and/or high resolution uncompressed textures), using manual derivatives may impart a significant performance penalty.