Can you show us what you tried? (Hint: Write down the definition of the line integral for one single segment to begin).
If you calculate the curl of this vector field, you will find that it equals zero and so the field is conservative. This means that it has path independence and regardless of the path you take, if you end up at the same place (P), the work done on it equals zero.
I do not get what you mean by using the 'partial function' to solve the line integral, do you mean you used the gradient function to solve for the curl?
To solve this line integral you have to parameterise the function and then solve