that is another option, and is certainly the better general solution for dealing with user defined functions.... , but since most of the cost is going to be computation of the jacobian, an analytic solution will be much faster. I tend to deal with very large problems, but for typical curve fitting it is probably adequate.