In this paper, two robust optimal control methods based on sliding mode design are introduced and implemented using the well-known unit vector approach. Time-varying sliding surfaces are implemented to solve linear optimal problems. The introduced sliding surfaces produce optimal controllers with respect to quadratic cost function. The presented design procedure is much easier than solving an HJB equation if one needs to achieve smaller costsپ than LQR controlled system (in which the controller designed for the linearized model and implemented to the original nonlinear model) Domain of attraction of closed-loop system is also bigger than LQR controlled system. The introduced methods are applied to an inverted pendulum system and the simulation results are presented and compared