<s>[INST] Compute the line integral of $x^2 + y^2$ on curve $|x|+|y|=1$ 
Compute the integral
$$\int_{\gamma} f(x,y)ds$$
where $\gamma=\{|x|+|y|=1\}$ and $f(x,y)=x^2+y^2$

Note, we have not covered any major theorems on evaluating line integrals, which has been presented is to parametrize the curve then integrate with respect to the parameter(roughly speaking). However, I have no idea how to paramatrize the curve. My intuition tells me we should probably split the curve into four cases, but then the derivative of the parametrizations will be zero? So how would I proceed? Input would be much appreciated!
 [/INST] $\gamma=\gamma_1+\gamma_2+\gamma_3+\gamma_4$ is the obvious sum of line segments: 1) $\gamma_{1}$ joins $(1,0)$ and $(0,1)$. 2) $\gamma_{2}$ joins $(0,1)$ and $(-1,0)$. 3) $\gamma_{3}$ joins $(-1,0)$ and $(0,-1)$. 4) 2) $\gamma_{4}$ joins $(0,-1)$ and $(1,0)$.
Then, $I=\int_{\gamma}(x^2+y^2)ds=\sum_{i=1}^4I_{i}$ where $I_i=\int_{\gamma_{i}}(x^2+y^2)ds$.
(1) Parametrization of $\gamma_1$: $x=t$, $y=1-t$, $0\leq t\leq 1$. Then $dx=dt$, $dy=-dt$, $ds=\sqrt{dx^2+dy^2}=\sqrt{2}dt$. Hence, $I_1=\int_0^1(t^2+(1-t)^2)\sqrt{2}dt=\sqrt{2}\int_0^1(2t^2-2t+1)dt=\frac{2\sqrt{2}}{3}.$
(2) Parametrization of $\gamma_2$: $x=t$, $y=t+1$, $-1\leq t\leq 0$. Then $dx=dt$, $dy=dt$, $ds=\sqrt{dx^2+dy^2}=\sqrt{2}dt$. Hence, $I_1=\int_{-1}^0(t^2+(1+t)^2)\sqrt{2}dt=\sqrt{2}\int_{-1}^0(2t^2+2t+1)dt=\frac{2\sqrt{2}}{3}.$
Here, we noticed that the orientation is not important.(Why?) Let's dicuss this. It is confusing. We could choose a counter-clockwise orientation of $\gamma_2$: $x=-t$, $y=1-t$, $0\leq t\leq 1$. Then $dx=-dt$, $dy=-dt$, $ds=\sqrt{dx^2+dy^2}=\sqrt{2}dt$. Hence, $I_1=\int_{0}^1((-t)^2+(1-t)^2)\sqrt{2}dt=\sqrt{2}\int_{0}^1(2t^2-2t+1)dt=\frac{2\sqrt{2}}{3}.$ Same result.
It seems that (3) and (4) computations will give the same result: $\frac{2\sqrt{2}}{3}$. Therefore, $I=4(\frac{2\sqrt{2}}{3})=\frac{8\sqrt{2}}{3}$.
</s>