The last integral equals 1 because its integrand is the N(θ,1) density. Therefore
E[Z]=e−θ2/2eθ2/2=1.
E[Z]=1 for every θ∈R
Key idea. Multiplying the N(0,1) density by eθx−θ2/2 gives exactly the N(θ,1) density. So Z is a likelihood ratio, and its mean is 1. This is the one-step version of the exponential martingale eθWt−θ2t/2 and of the Girsanov change of measure.