Answer:
a) The function is

b) The value of the integral is 18
Explanation:
a) We are given that
. We want to find a function f such that the gradient of f is F. That is
. Suppose that such f does exist, if that is the case, then by definition of the gradient, we have that

From here, we have that

if we integrate both sides with respect to x, we get that

where g is a function that depens on y and z only. Now, we differentiate this equation with respect to y and make it equal to the 2nd component of F. That is

This implies that
. This means that g actually depends only on z. Until now, f is of the form
If we repeat the previous step, by differentiating with respect to z and making it equall to the third component of F we get

This implies that
. If we integrate both sides with respect to z, we get that

So f is of the form

b) To calculate the integral over the given segment, we can use the function f. Since the path is from (1,0,-2) to (6,4,1), then the value of the integral is given by evaluatin f at the end point and the substracting the value of f at the start point, that is