The crystal structure of (Ba0.5Sr0.5)TiO3 was studied by the generalized gradient approximation based on fist principles method. Comparisons of the results with experimental values ensure that the method chosen is feasible. The lattice parameters, electrical structure and optical properties of Hf doped (Ba0.5Sr0.5)TiO3 were calculated and analyzed by the same method. The dielectric function was analyzed primarily. The calculated result shows that the structure of Hf doped (Ba0.5Sr0.5)TiO3 is tetragonal phase. Compared with (Ba0.5Sr0.5)TiO3, the symmetry and dielectric constants become lower, and the dielectric peak becomes widened.