Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
The modified E has two parts: first part will be divergent and independent of z, while the second part is finite and depends on z. I thought that is exactly what the question is asking for.
Why don't you take the location of Q1 as your reference point? This will simplify your math. Since what is required is the Energy (between) the two charges, the choice of your reference point is totally up to you.