In the present paper, an exact analytic solution for the optimal unambiguous state discrimination(OPUSD) problem involving an arbitrary number of pure linearly independent quantum states with real and complex inner product is presented. Using semidefinite programming and Karush-Kuhn-Tucker convex optimization method, we derive an analytical formula which shows the relation between optimal solution of unambiguous state discrimination problem and an arbitrary number of pure linearly independent quantum states.