In the optimization of continuous-time dynamical systems, it can be important to numerically calculate the parametric sensitivity of some long-time-averaged quantities in the system. These computations are challenging for typical numerical methods in the presence of oscillations, which can originate from the internal structure of an autonomous dynamical system or be caused by an external periodic excitation. The case of periodic excitation is motivated by the problem of heat conduction in mechanical parts in engines, where the mean strength of the heat fluctuation can be an important parameter in the engineering design. In this work, approaches to transform periodically excited systems into autonomous systems appropriate for sensitivity analysis were investigated. The least-squares shadowing method is used to compute the sensitivities, and the effect of different kinds of transformation compared. The resulting numerical method is presented using the motivating example of heat conduction.