Automatically apply a derivative function when necessary to satisfy a requested unit

Just a draft- this will probably need more changes