abstract: We study an optimal design problem consisting in mixing two anisotropic (electric or thermal) materials in order to minimize a cost functional depending on the gradient of the state. This type of problems has not a solution in general and then it is necessary to introduce a relaxed formulation. We prove that this relaxation is obtained by using composite materials, constructed via homogenization, and taking a particular extension of the cost functional to these new materials. We also obtain an integral representation of this relaxed cost functional.