My problem is that I'm confused about a hint I was given in this problem. I usually use the law of cosine to find the length of [itex]\vec{r}-\vec{r'}[/itex]. But the hint here says that I should make it [itex][r^2 + (z - z_0)^2]^{1/2}[/itex]

Where does this come from? I can't quite get my head around the geometrical idea of this hint. Can't the law of cosine be used here?