title: User defined Jacobian in MATLAB's lsqnonlin
body: <p>When using MATLAB's <a href="http://www.mathworks.com/help/toolbox/optim/ug/lsqnonlin.html" rel="nofollow">lsqnonlin</a> function, I am trying to give a user-defined Jacobian matrix, as described in the documentation.</p>
  
  <p>The output of the objective function used in lsqnonlin should be a vector of unsquared values, which, when squared and summed, give the energy. However, should the Jacobian be the partial derivates of the <em>squared</em> or <em>unsquared</em> values?</p>