: In this paper, a novel optimal control design method by discontinuous quadratic Lyapunov function and continuous quadratic Lyapunov function for 2-dimensional piecewise affine systems via semi-definite programming and LMI constraints is proposed.In fact, for designing optimal control we use from two different criteria. At the first, an upper bound for a quadratic cost function for a stable closed-system is obtained. Then after, considering a state-feedback control approach, not only sufficient conditions for the stability of the closed-loop system but also the upper bound of the cost function are obtained. The optimization problem is formulated as a semi-definite programming with bilinear constraints (BMI). Some variables in BMIs are searched by genetic algorithm, so the bilinear constraints are converted to linear constraints and the controller coefficients are calculated. The effectiveness of the proposed method is verified by numerical examples. The simulation results show that discontinuous quadratic lyapunov functions are more efficient that continuous quadratic lyapunov functions.