also output dTp and dpT.

notice: the derivatives seem to be wrong at the critical point