In a universe with a cosmological constant, the large‐scale gravitational potential varies in time and this is, in principle, observable. Using an N‐body simulation of a Λ cold dark matter universe, we show that linear theory is not sufficiently accurate to predict the power spectrum of the time derivative, , needed to compute the imprint of large‐scale structure on the cosmic microwave background (CMB). The linear part of the power spectrum [the integrated Sachs–Wolfe effect (ISW)] drops quickly as the relative importance of ΩΛ diminishes at high redshift, while the non‐linear part [the Rees–Sciama effect (RS)] evolves more slowly with redshift. Therefore, the deviation of the total power spectrum from linear theory occurs at larger scales at higher redshifts. The deviation occurs at k∼ 0.1 h Mpc−1 at z= 0. The cross‐correlation power spectrum of the density δ with behaves differently from the power spectrum of . First, the deviation from linear theory occurs at smaller scales (k∼ 1 h Mpc−1 at z= 0). Secondly, the correlation becomes negative when the non‐linear effect dominates. For the cross‐correlation power spectrum of galaxy samples with the CMB, the non‐linear effect becomes significant at l∼ 500 and rapidly makes the cross‐power spectrum negative. For high‐redshift samples, the cross‐correlation is expected to be suppressed by 5–10 per cent on arcminute scales. The RS effect makes a negligible contribution to the large‐scale ISW cross‐correlation measurement. However, on arcminute scales it will contaminate the expected cross‐correlation signal induced by the Sunyaev–Zel'dovich effect.