In this paper, the finite element formulation of the methodology for the calculation of the large deflection of toroidal shells using a mathematical programming technique is presented. Geometrical nonlinearity is taken account of the relation between strain and displacement. The forth-order total potential energy expressed in terms of displacement components is minimized by Davidon-Fletcher-Powell method, and unknown displacements of the nodal points can be obtained. Numerical examples are shown for the pipe bends subjected to in-plane bending to show the effects of the increase of the the stress intensification factor on the geometrical nonlinearity.