An analytic method for sensitivity analysis of complex systems