Strain gradients in epitaxial ferroelectrics