Over recent years, the world has experienced an explosive growth in the volume of shared web texts. Everyday, a huge volume of opinions expressed in various forms such as articles, reviews and tweets is generated. In general, opinion mining refers to the task of extracting opinions, and sentiment analysis is the technique that extracts subjectivity and polarity; in other words, it determines whether a text is positive or negative (Taboada et al., 2011). Arabic sentiment analysis is conducted in this study using a publically available data set written in both modern standard Arabic and the Jordanian dialect. A new mathematical approach is introduced to determine the polarity of the tweet by using four functions whose parameters are the solutions of a linear program. These functions are then classified using support vector machines and K-;nearest neighbours. The results show that the proposed approach is considerably reliable in Arabic sentiment analysis.