This paper examines the problem of deriving the tangent (or market) portfolio from a given set of risky assets and a specified risk-free borrowing and lending rate. Deriving the tangent portfolio involves solving a mathematical programming problem which can be specified as the minimization of a quadratic objective function with linear constraints. The complementary pivot algorithm has previously been shown to be capable of deriving the optimal solution to certain quadratic programming problems, subject to a nonnegativity constraint. This paper demonstrates that the algorithm can be used to derive the tangent portfolio and that the nonnegativity constraint does not pose any serious handicap. Furthermore, it is shown that the algorithm can efficiently solve large-scale problems of this nature.