Surface-mounted permanent magnet machines are widely used in low and medium speed applications. Pulsating torque components is the most crucial challenge, especially in low-speed applications. Magnet pole shape optimization can be used to mitigate these components. In this research, an analytical model is proposed to calculate the magnetic vector potential in surfacemounted permanent magnet machines. A mathematical expression is also derived for optimal the magnet shape to reduce the cogging torque and electromagnetic torque components. The presented model is based on the resolution of the Laplace’s and Poisson’s equations in polar coordinates by using the subdomain method and applying hyperbolic functions. The proposed method is applied to the performance computation of a surface-mounted permanent magnet machine, i.e., a 3-phase 12S-10P motor. The analytical results are validated through the finite element analysis (FEA) method.