We introduce a mathematical framework for the analysis of the input-output dynamics of externally driven memristors. We show that, under general assumptions, their dynamics comply with a Bernoulli differential equation and hence can be nonlinearly transformed into a formally solvable linear equation. The Bernoulli formalism, which applies to both charge-and flux-controlled memristors when either current or voltage driven, can, in some cases, lead to expressions of the output of the device as an explicit function of the input. We apply our framework to obtain analytical solutions of the i-v characteristics of the recently proposed model of the Hewlett-Packard memristor under three different drives without the need for numerical simulations. Our explicit solutions allow us to identify a dimensionless lumped parameter that combines device-specific parameters with properties of the input drive. This parameter governs the memristive behaviour of the device and, consequently, the amount of hysteresis in the i-v. We proceed further by defining formally a quantitative measure for the hysteresis of the device, for which we obtain explicit formulas in terms of the aforementioned parameter, and we discuss the applicability of the analysis for the design and analysis of memristor devices.