An engine exhaust manifold made of cast iron cracks during thermal shock testing. The test process is simulated by finite element analysis. The manifold is formulated as a linear heat transfer and thermoelasticity problem in a variational form. Analytical expressions for shape design sensitivities of general three-dimensional problems are presented, using the material derivative approach. A hybrid approach is described and used during the optimization process. This approach takes advantage of the direct and the adjoint variable methods and is the most efficient in calculating the sensitivity of the structural responses. After the finite element model is verified by comparing the results with those from testing, the engine exhaust manifold is optimized with respect to its geometry.