Relaxation of certain integral functionals depending on strain and chemical composition