The result is that the electron wave after it has been diffracted can be written as an integral over different plane waves: ψ ψ ( r ) = ∫ ∫ ϕ ϕ ( k ) exp ⁡ ⁡ ( 2 π π i k ⋅ ⋅ r ) d 3 k , that is a sum of plane waves going in different directions, each with a complex amplitude ϕ ϕ ( k ) . (This is a three dimensional integral, which is often written as d k rather than d 3 k .) For a crystalline sample these wavevectors have to be of the same magnitude for elastic scattering (no change in energy), and are related to the incident direction k 0 by (see Figure 6)