In this talk, we will introduce a dynamic mathematical model that describes the interaction of the immune system with the human immunodeficiency virus (HIV). Using optimal control theory, we will illustrate that optimal dynamic multidrug therapies can produce a drug dosing strategy that exhibits structured treatment interruption, a regimen in which patients are cycled on and off therapy. In addition, sensitivity analysis of the model including both classical sensitivity functions and generalized sensitivity functions will be presented. Finally, we will describe how stochastic estimation can be used to filter and estimate states and parameters from noisy data. In the course of this analysis it will be shown that automatic differentiation can be a powerful tool for this type of study.