The Finite Element Method (FEM) is one of advanced methods in modeling of solid mechanics used in the design and analyzing of prosthesis in the human body. One of the important factors in designing a femur (the linkage between basin and knee) which is under complicated stresses is to minimize the amount of the stress in the components of the prosthesis due to the body weight. In this research the authors have used prosthesis of two different substances to investigate the affect of the materials in the fatigue analyze. The other important factor is to apply a suitable linkage between prosthesis and bone called cement in order to prevent the slip of stem shape in the femur. In finite element analyze we have used contact elements for modeling the surfaces in contact. For the contact surface of stem shape and femur we have considered three cases: Bonded, slippage with the coefficient of friction 0, 0.22. We have used Genetic Algorithms (GA) method to optimize the shape of prosthesis. The results have been compared with the results presented by Charnley which shows an improvement in the shape of prosthesis. The optimized angle is about 132 degrees.