How To Differentiate A Function In Python