Parametric sensitivity analysis is becoming a very important tool when studying differential equations. However, potential pitfalls exist if this analysis is applied naively. In particular, if the model contains discontinuities, then the application of standard numerical codes will typically result in incorrect sensitivity trajectories. The purpose of this paper is to demonstrate the problems associated with ‘‘hidden discontinuities’’ during sensitivity analysis (i.e., discontinuities not handled explicitly) and to present a code analysis and transformation approach through which differential equations containing discontinuities can be solved efficiently and correctly with minimal effort required by the modeler.