Automatic history matching is based on minimizing an objective function that quantifies the mismatch between observed and simulated data. When using gradient-based methods for solving this optimization problem, a key point for the overall procedure is how the simulator delivers the necessary derivative information. In this paper, forward and adjoint methods for derivative calculation are discussed. Procedures for sensitivity matrix building, sensitivity matrix and transpose sensitivity matrix vector products are fully described. To show the usefulness of the derivative calculation algorithms, a new variant of the gradzone analysis, which tries to address the problem of selecting the most relevant parameters for a history matching, is proposed using the singular value decomposition of the sensitivity matrix. Application to a simple synthetic case shows that this procedure can reveal important information about the nature of the history-matching problem.