## Length of the vector (electrostatic cylinder)

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 $\vec{r}-\vec{r'}$. But the hint here says that I should make it $[r^2 + (z - z_0)^2]^{1/2}$

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?
 PhysOrg.com physics news on PhysOrg.com >> Study provides better understanding of water's freezing behavior at nanoscale>> Soft matter offers new ways to study how ordered materials arrange themselves>> Making quantum encryption practical
 It's really hard to answer these questions when you don't specify what any of the terms mean, so I can only guess at what r-r' even is. It looks like a Pythagoras approach to give you the hypotenuse of the triangle with sides r and z-z0. How would you use the law of cosine, and what problem would using it solve?
 I don't know how the hint is specifically formulated but I think the best way here is to use cylindrical coordinates. It may be that r' is the cylindrical radius of the charge element. The point P has r=0 and z=zo.