Density functional theory is a widely used electronic structure method. In this work, we demonstate an accurate and scalable approach to computing derivatives within this framework which relate to optics experiments. This allows us to study real materials, in particular how they are affected by defects.