Solution (source code)

= Solution

Parametrize the straight segment by $x=t$, $y=1+t$, $0\leq t\leq1$. The <line integral> becomes
$$
\begin{aligned}
\int_0^1\bigl[t^2-(1+t)+(1+t)^2+t\bigr]\,dt
&=\int_0^1(2t^2+2t)\,dt\\
&=\boxed{\frac53}.
\end{aligned}
$$