added matrix, jacobian, and derivatives

added matrix, jacobian,
and derivatives code and
sample program to compute them.