gradient for linear regression with regularization