how to differentiate parametric function