A comprehensive, universally valid, elegant and yet simple method to design slender axisymmetric body of minimum wave drag in transonic and supersonic flows is developed. Computational aerodynamics is also used as a tool for numerical experiments in gaining physical understanding of the drag mechanism due to the geometry of the aftbody, such as the correlation between wave drag and wave distribution of the aftbody geometry. The method utilizes MFD (modified feasible direction) based optimization program, along with the linear slender body aerodynamics, for its elegance and generic optimization convenience. The efforts are focused on inviscid flow. A practical method of reducing the wave drag of a given body is developed for both bodies with pointed end and with base area, using shock wave generator at a particular location on the aftbody. The results show that the MFD optimization program can be effectively utilized in an aerodynamic optimization problem