goonking said:
If I take the path from A to B, should the lower and upper bounds be 0 and 4.47?
But what will you integrate with respect to? dx? dy? something else?
If you want to integrate along the straight line path, you would need to introduce a parameter. Call ##\vec A## and ##\vec B## the positions of points A and B respectively. Let's call the parameter s. Then you could parameterize the position vector of the charge like this:
##\vec R=\vec A+\frac{\vec B-\vec A}{|\vec B - \vec A|}s##.
See, ##\frac{\vec B-\vec A}{|\vec B - \vec A|}## is the unit vector from A to B. So, when you move along the parameter s, you are moving along the straight line from A to B (and the magnitude of s represents how far you've moved from A).
Then we would have
##d\vec D = \frac{\vec B-\vec A}{|\vec B - \vec A|}ds##
and then we would integrate from ##0 \text{ to }|\vec B - \vec A|## (≈4.47).
Slightly simpler would be to use the parametrization ##\vec R=\vec A+(\vec B-\vec A)s## and integrate from s=0 to s=1. (See when s=0, ##\vec R=\vec A##, and when s=1, ##\vec R= \vec B##)You can choose any path you want though. I would suggest integrating along the path consisting of two straight lines, from (2,0) to (0,0), and then from (0,0) to (4,0). Then you can integrate with respect to dy for the first part, and w.r.t. dx for the second part.