Wow, you've got some unique ideas about using PID!
When you say "take the derivative of a temperature", do you mean calculating the rate of change of the temperature with time (dT/dt)? If so, it's far easier to just do the arithmetic than try to extract the derivative from the PID equation.
Set up a self-resetting timer or a timed interrupt at any convenient time increment. Calculate the difference between the current temperature value and the stored value from the last time you did the calculation. Divide that difference by the time increment to get the rate of change, and copy the current temperature value to the storage location.