In this thesis fluctuation theorems and their derivations are considered and Jarzynski equation as one of the most important theorems is reviewed for simple and compound quantum systems. Then we extended it for a situation in which the system is driven away from equilibrium by work performed on it and during this process the temperature of the system is changed. We investigate this generalized equation for classical and quantum systems and to confirm its validity in a practical case, we work out this extended equation for a one – dimensional harmonic oscillator that its equilibrium point and temperature is change.