The problem to find the shape of a body with smallest drag in a flow governed by two-dimensional steady Navier-Stokes equations is considered. The flow is expressed in terms of stream function which satisfies a fourth-order partial differential equation with the biharmonic operator as principal part. The sensitivities of the direct solution up to the second order are derived by the Hadamard method, which is an extension of Fujii's result on the second-order equation. Using adjoint variable approach both the first-order and the second-order necessary conditions for the shape with smallest drag are obtained. An algorithm for the calculation of optimal shape in which the first variations of solutions of direct and adjoint problems are incorporated is proposed. Numerical examples show that the algorithm can produce successfully the optimal shape. The numerical calculations are made at Reynolds numbers of 1, 10, 20 and 40.