Abstract: The inference of the interior properties of the Sun and Earth using surface measurements of the seismic wavefield are active areas. I will discuss the construction of accurate forward models for seismic wavefields and the solution of the inverse problem using PDE-constrained optimization. These techniques are useful when attempting to invert for the structure of strong 3-D heterogeneities such as sunspots and Earth's crustal structure/exploration.