Given $A(-1,-2)$; $B(2,1)$ the arc $AB$ is from the following circle $(x-\frac{1}{2})^2+(y+\frac{1}{2})^2=\frac{9}{2}$. calculate $\int _T \frac{y}{x^2+y^2}dx-\frac{x}{x^2+y^2}dy$ $T$ is the arc $AB$ from point $A$ to point $B$
I tried to solve this in a couple of ways but I don't know which one is right and why.
First was using potential since $P_y=Q_x$ , the potential is $\phi=arctan(\frac{x}{y})+c$ so I did $\phi(2,1)-\phi(-1,-2)$= $arctan(\frac{2}{1})$- $arctan(\frac{1}{2})$ but this seemed wrong for some reason..
The second thing was changed the line to going from point $A$ to a new point $D$ and then to point $B$ so it would be like that $(-1,-2)$ $\implies(2,-2)$ $\implies$ $(2,1)$ and $C:(t,-2)$ $C_1: (2,t)$
first integral : $\int_C \frac{-2}{t^2+4} \cdot1 -0 dt$ $=$ $-arctan(1)+arctan(\frac{-1}{2})$
Second integral : $\int_{C_1}0- \frac{2}{t^2+4} \cdot1 dt$ $=$ $-arctan(\frac{1}{2})+arctan(-1)$
Adding them I got : $-1.24-1.24=-2.48$
Third and last thing I tried was what the lecturer recommended and it was making a new equation that contains the two points and it would be $x^2+y^2=5$ because $||A||=||b||= \sqrt{5}$ but I could not complete it because I could not find $t_a \leq t \leq t_b$
thank you for any tips and help , and if the first way is not right then in which conditions can I use this?

Specifically on line integral from point $A (-1,-2)$ to point $B (2,1)$, yes you can evaluate it over the arc of the circle $x^2 + y^2 = 5$ as the vector field is conservative in a domain that does not include origin.
$r(t) = (\sqrt5 \cos t, \sqrt5 \sin t)$
$t_A = - \dfrac{\pi}{2} - \arctan \left(\dfrac{1}{2}\right), \ $ $t_B = \arctan \left(\dfrac{1}{2}\right)$
$r'(t) = (- \sqrt5 \sin t, \sqrt5 \cos t)$
$\vec F (r(t)) = \left(\dfrac{\sin t}{\sqrt5}, - \dfrac{\cos t}{\sqrt5}\right)$
So the line integral is $\displaystyle \int_{- (\pi/2) - \arctan (1/2)}^{\arctan(1/2)} - \ dt \approx - 2.4981$
On your first approach, please note that $- \arctan \left(\dfrac{y}{x}\right)$ has discontinuity at $x = 0$ (y-axis). It would work if we are restricted in the first and fourth quadrants.