Inhomogeneous Perpendicular Magnetic Anisotropy as a Source of Higher-order Quasistatic and Dynamic Anisotropies