We demonstrate how the structure that arises in inverse and optimal design problems can be used to aid in the efficient application of automatic differentiation ideas. We discuss the program structure of generic inverse problems and then illustrate, with two examples (one example involves the heat equation, the other involves wave propagation) how structure can be used in combination with automatic differentiation. Finally, we report numerical results and describe the ADMIT-2 software package which enables efficient derivative computation of structured problems.