The electric field due to an infinitely long cylinder of radius r, at a distance x from its center can be found by Gauss' Law, and is found to be E = r/x away from the cylinder. Also, the electric field at any point inside the cylinder is zero (using Gauss' Law)
Consider an origin O at any point on the axis of the +vely charged cylinder. Let the X axis start from this point O, perpendicular to the axes of both the cylinder. Hence, at a point at a distance x from the origin O (outside the cylinder), E = r/x i+ (-)r/(a-x)(-i) = r/[1/x+ 1/(a-x)]i
Potential difference between the axes of +ve and the -ve cylinder is V = - a0E.dr = - aa-r0.dr -a-rrE.dr -r00.dr V = - a-rrr/[1/x+ 1/(a-x)]i . dxi = - (r/) a-rr [1/x+ 1/(a-x)]dx V = (2r/)ln[(a-r)/a]