differentiate from first principles