The error function can be calculated based on the Simpson method through a subroutine program. An integration program by FORTRAN language was made for diffusion equations of extended source with infinite extent and limited extent. The distribution curves of alloying elements could be driven from calculated results written in ASCII code. The results on some alloying elements such as C, Co, Cr, Mn, Me, Ni and V's diffusion in iron, showed the diffusion distance for Ni and Mo can only be 1 similar to 3 mu m and more distance for Co at common sintering temperature of 1120 degrees C. Increasing the sintering temperature up to 1300 degrees C, distribution curve could be improved. To refine the particle size of the added elements down to a scale of micrometers is an effective way to get homogeneous distribution.