Nonlinear disturbance observers owing to their simplicity in implementation have seen remarkable success in motion control. Although, the underlying principle behind disturbance observers is straightforward, finding the corresponding observer gain matrix is non-trivial and often becomes a problem specific task. In addition, for cases where the disturbance enters the system through a different channel than the input, termed as the mismatching condition, disturbance observer and compensation design can be challenging. In this paper, we propose a sum-of-squares method to design disturbance observers for polynomial nonlinear systems with guaranteed exponential stability. The exponential stability of the disturbance observer enables its usage in a composite control structure with any asymptotic or finite time stable control scheme. Furthermore, we demonstrate the design of the disturbance compensation gain which when applied to systems with mismatched uncertainties ensures input-to-state stability (ISS) of the system. The ISS-Lyapunov analysis for the combined disturbance observer and the polynomial system is carried out using sum-of-squares programming. To numerically validate our proposed approach, we investigate robust disturbance observer based control for both matched and mismatched disturbances.