Surface mounted permanent magnet machines are widely used in low and medium speed ap-plications. Pulsating torque components are the most crucial challenges, especially in low speed applications. Magnet pole shape optimization can be used to mitigate these compo-nents. In this research, an analytical model is proposed to calculate magnetic vector potential in surface mounted permanent magnet machines. A mathematical expression is also derived for optimal magnet shape to reduce cogging torque and electromagnetic torque components. The presented model is based on the resolution of Laplace equation in polar coordinate by us-ing sub-domain method and applying hyperbolic functions. The proposed method is applied on the performance computation of two prototype surface mounted permanent magnet ma-chine, i.e., a 3-phase 12S-6P motor and a 12S-10P motor. The analytical results are validated through FEA method.