computing & plotting derivatives