# Jacobians and least squares normal equations

I am trying to solve a problem with non-linear least squares (Gauss-Newton), but the question is more about a single iteration, or least squares.

The Jacobian $J$ for each constraint is a 1x6 vector. Then I get the normal equations for the single constraint which I could stack:

$A[] = J * J^T$

$b[] = J * e$

and I solve the system with Cholesky (using the Eigen library).

The curious thing I saw on the Internet is that, instead of stacking these constraints, they are summed:

$A = A + J * J^T$ (6x6 matrix)

$b = b - J * e$ (1x6 vector)

Does it give the same result and does it have the same meaning? I suppose it is done for computational efficiency, because the matrix to solve will always be small.

PS: corollary question, once I have my analytic Jacobians calculated, how can I prove/test they are correct? I don't know if there is a generic answer to this, or it depends on the case.