HIV poses a great threat to humanity for two major reasons. First it attacks the immunity system of the body and second, it is epidemic in nature. Mathematical models of HIV have been instrumental in understanding and controlling the infection. In this paper, we solve the between host epidemic model of HIV, described by nonlinear coupled differential equations, by using memetic computing. Under this model, the sexually active population is divided into four classes and we investigate the transfer of individuals from one class to another. The solution consists of Bernstein polynomials whose parameters have been optimized by using differential evolution as global and sequential quadratic programming as local optimizer. Our second contribution is the stability analysis of this model. The disease-free equilibrium is stable while endemic equilibrium is unstable within the practical range of the values of parameters.