Derivatives of Probability and Integral Functions: General Theory and Examples