This paper analyzes the impact of R&D activities in an oligopoly on consumer surplus and social welfare. We use a two-stage model to analyze the behavior of duopolists at the research level, and in the final-product market, under the assumption of linear and quadratic cost functions. Three options for firm competition are considered: 1) Cournot competition at both stages; 2) cooperation at the R&D stage and Cournot competition in the final-product market; and 3) cooperation at both stages. Numerical simulations for various levels of R&D spillovers are conducted to analyze the welfare effects of firm decisions. We conclude that for high levels of technological spillovers, total welfare is highest when firms engage in cooperation at the R&D stage, and compete in the final product market, independent of the shape of cost functions. However, the functional form of production costs has a qualitative impact on welfare when firms fully compete.