Various algorithms for optimal control require the explicit determination of switching surfaces. However, switching strategies may be very complicated, such that the computation of switching surfaces is quite challenging. General methods are proposed here to compute switching surfaces systematically, based on algebraic computational tools such as triangular decomposition. Our methods are highly complex compared to some widely-used numerical options, but they can be made feasible for real-time applications by moving the computational burden off-line. The tutorial-style presentation is intended to introduce potentially powerful symbolic computation methods to system scientists in particular, and an illustrative example of time-optimal control is given to show the effectiveness and generality of our approach.