differentiate from first principles 2x