# Calculate $\int_{C} \frac{x}{x^2+y^2} dx + \frac{y}{x^2+y^2} dy~$ where $C$ is straight line segment connecting $(1,1)$ to $(2,2)$

Calculate $$\int_{C} \frac{x}{x^2+y^2} dx + \frac{y}{x^2+y^2} dy~$$ where $$C$$ is straight line segment connecting $$(1,1)$$ to $$(2,2)$$

my question is , after calculating the integral using green theorem i got that $$\int_{C} \frac{x}{x^2+y^2} dx \frac{y}{x^2+y^2} dy= -\ln(2)$$

is it the right answer ? since we are connecting $$(1,1)$$ to $$(2,2)$$ AND NOT $$(2,2)$$ to $$(1,1)$$

so its question about the sign of the value.

• Green's theorem is for closed curves. Yours isn't. This is a conservative force field, so find the potential function. – B. Goddard Jan 9 at 14:36
• I closed it with parametrization – Mather Jan 9 at 16:02
• You should add that to your answer so we can see what you did wrong. – B. Goddard Jan 9 at 16:28
• Because this is a conservative field, so the integral over a closed curve should be zero. Further, if you use Greens theorem, you get a double integral over a region of area zero, and so, for another reason, you should get zero. – B. Goddard Jan 9 at 18:30
• but someone posted that the answer is $\ln(2)$ @B.Goddard – Mather Jan 9 at 19:46

$$(1,1),(2,2)$$ are joined by the line-segment $$C:y=x\in[1,2]$$. The integral becomes $$\int_C\frac{xdx+ydy}{x^2+y^2}=\int_C\frac{2xdx}{2x^2}=\int_1^2\frac{dx}x=\ln(2)$$
Alternatively, $$\int_C\frac{xdx+ydy}{x^2+y^2}=\int_C\frac12\cdot\frac{d(x^2+y^2)}{x^2+y^2}=\frac12\int_2^8\frac{dm}m=\frac12\ln(m)\Big|_2^8=\ln(2)$$where $$m=x^2+y^2$$, that goes from $$1^2+1^2\to2^2+2^2$$.
The fundamental theorem of calculus tells you that if $${\bf F} = \nabla f$$ in a simply connected region containing the curve, then $$\int_C {\bf F}\cdot d{\bf r}= f(b) - f(a)$$ where the curve $$C$$ begins at the point $$a$$ and ends at the point $$b$$.
Here $${\bf F}(x,y) = \left(\frac{x}{x^2 + y^2}, \frac y{x^2 + y^2} \right).$$ Can you find a function $$f(x,y)$$ such that $${\bf F}(x,y) = \nabla f(x,y)?$$