Flow integral in $\mathbb R^2$ Calculate the flow $\int_\gamma \vec{v} \cdot \vec{n} \,ds$ from inside to outside for $\vec{v}=(x-y^2, y-x^2)$ for the path in the following figure:

Parametrization:
We parametrizie the path in two parts. The solution does use $[-\pi/2, \pi/2]\to\mathbb R^2$ but I want to use $[\pi/2, -\pi/2]$ (Might be important.)
$\gamma_1: [\pi/2, -\pi/2] \to \mathbb R^2, \quad t\mapsto \begin{pmatrix}t\\ \cos(t) \end{pmatrix}$
$\dot{\vec{\gamma_1}}=\begin{pmatrix}1\\ -\sin(t) \end{pmatrix} \quad \implies \quad \vec{n_1}=\begin{pmatrix}\sin(t) \\ 1 \end{pmatrix}$
$\\$
$\gamma_2: [-\pi/2, \pi/2] \to \mathbb R^2, \implies t\mapsto \begin{pmatrix}t\\ 0 \end{pmatrix}$
$\dot{\vec{\gamma_2}}=\begin{pmatrix}1\\ 0 \end{pmatrix} \quad \Rightarrow \quad \vec{n_1}=\begin{pmatrix}0 \\ -1 \end{pmatrix}$
Integral:
$$\int_{\gamma_1} \vec{v}\cdot\vec{n_1} \,ds = \int_{\pi/2}^{-\pi/2}\big(t\sin(t)-\cos^2(t)\sin(t)+\cos(t)-t^2 \big)\,dt = \cdots = -4 + \pi^3/12$$
$$\int_{\gamma_2} \vec{v}\cdot\vec{n_2} \,ds = \int_{-\pi/2}^{\pi/2}t^2\,dt = \cdots = \pi^3/12$$
Result:
$-4+\pi^3/12 + \pi^3/12$
Question:
The actual result is $4$. So, I don't know where my mistake is. I mean, I should be able to parametrize the way I did and I don't see any error but still, I do have a sign error somewhere.
 A: Notice that your $\dot{\vec{\gamma_1}}(t)=\begin{bmatrix}1\\ -\sin(t) \end{bmatrix}$ vector has opposite sign than the one on the image, for example $\dot{\vec{\gamma_1}}(0) = \begin{bmatrix}1 \\ 0 \end{bmatrix}$. This is ok because the domain is $\left[\frac{\pi}2, -\frac{\pi}2\right]$. However, your normal vector $\vec{n_1}$ has the same sign. To get the normal vector, you have to rotate $\dot{\vec{\gamma_1}}$ by $\frac\pi2$ clockwise:
$$\vec{n_1}(t) = \begin{bmatrix} 0 & 1 \\ -1 & 0\end{bmatrix}\dot{\vec{\gamma_1}} = \begin{bmatrix} 0 & 1 \\ -1 & 0\end{bmatrix}\begin{bmatrix}1\\ -\sin(t) \end{bmatrix} = \begin{bmatrix} -\sin(t) \\ -1 \end{bmatrix}$$
This yields the correct result.

Anyway, the result can be obtained much easier by using the two-dimensional divergence theorem: $$\left(\operatorname{div}\vec{v}\right)(x,y) = \frac{\partial}{\partial x}(x-y^2) + \frac{\partial}{\partial y}(y-x^2) = 2$$
so $$\int_{\vec\gamma} \vec{v}\cdot \vec{n}\,ds = \int_\limits{\text{area enclosed by }\vec{\gamma}}\operatorname{div}\vec{v} = 2\int_{-\frac\pi2}^\frac\pi2 \cos x\,dx = 4$$
