So on Khan Academy where this derivation is performed you are given $\dfrac{dT}{dt} = -k(T-T\_a)$, where $T$ is the final temperature and $T\_a$ is the, constant, environmental temperature.

From here you would rearrange this equation into $\dfrac{dT}{-k(T-T\_a)} = -k\,dt$. However, here is where I am confused. From here the next step seems to be to integrate both sides, but I don't understand why this is possible. On the left side you are integrating with respect to temperature whereas on the right side you are integrating with respect to time.

I always assumed that the reason why we could perform any function like this was because one would always do the exact same thing to both sides of the equation, and I believe that reasoning still holds true. What am I missing here?