Based on the modified Landau-Lifshitz-Gilbert equation for an arbitrary Stoner particle under an external magnetic field and a spin-polarized electric current, differential equations for the optimal reversal trajectory, along which the magnetization reversal is the fastest one among all possible reversal routes, are obtained. We show that this is a Euler-Lagrange problem with constrains. The Euler equation of the optimal trajectory is useful in designing a magnetic field pulse and/or a polarized electric current pulse in magnetization reversal for two reasons. 1) It is straightforward to obtain the solution of the Euler equation, at least numerically, for a given magnetic nano-structure characterized by its magnetic anisotropy energy. 2) After obtaining the optimal reversal trajectory for a given magnetic nano-structure, finding a proper field/current pulse is an algebraic problem instead of the original nonlinear differential equation.