Fixed bug in matrices.py
Added derivative.