coeu_grad function

Auxiliary function for gradients and delta2