We present an investigation into the effect of nonlinearities on the response of cantilever microbeams under mechanical shock and electrostatic loading. The nonlinear Euler-Bernoulli beam theory is used to model the microbeam, accounting for cubic geometric and inertia nonlinearities, in addition to the nonlinear electrostatic forces in the case of electrostatic actuation. The influences of the different components of nonlinearity are examined. The results of the nonlinear model are compared to results obtained from linear beam theory and finite-element simulations (ANSYS). For mechanical shock loading, both quasi-static and dynamic responses of a microbeam are considered. The effect of nonlinearity is found to be significant when the deflection of the microbeam exceeds around 30% of its length. The consequence of the large deflection is that the geometric nonlinearity has a much stronger influence on the response in comparison to the inertia nonlinearity. For electrostatic actuation, it is found that using a nonlinear beam model to predict the pull-in and the deflection produces a slight improvement over using a linear beam model.