The polarization in a ferroelectric thin film: local and nonlocal limit problems