Parameterize the line segment by
[tex]\mathbf r(t)=\langle0,0,1\rangle(1-t)+\langle3,1,0\rangle t[/tex]
[tex]\mathbf r(t)=\langle3t,t,1-t\rangle[/tex]
with [tex]0\le t\le1[/tex]. Then the work done along the path (call it [tex]\mathcal C[/tex]) is
[tex]\displaystyle\int_{\mathcal C}\mathbf f\cdot\mathrm d\mathbf r=\int_{t=0}^{t=1}\mathbf f(\mathbf r(t))\cdot\mathrm d\langle3t,t,1-t\rangle[/tex]
[tex]=\displaystyle\int_0^1\langle3t-t^2,t-(1-t)^2,1-t-(3t)^2\rangle\cdot\langle3,1,-1\rangle\,\mathrm dt[/tex]
[tex]=\displaystyle\int_0^1(5t^2+13t-2)\,\mathrm dt=\frac{37}6[/tex]