Finding the line integral of a path in a cube I want to consider a continuous closed path $\alpha(t)$, which is drawn over the edges of a cube in $\mathbb{R^3}$ and passes through the points $(0, 0, 0)$ and $(3, 3, 3)$ (these last two points are vertices of the cube).
We have that the given vector field is $f:\mathbb{R^3} \rightarrow \mathbb{R^3}$ given by $f(x, y, z)=(-y, x, z)$
We must parameterize then this path, we can take the following path
From $(0, 0, 0)$ to $(0, 0, 3)$ to $(0, 3, 3)$ to $(3, 3, 3)$, then parameterizing each line segment we have
$$\alpha_{1}=[(0, 0, 0) +t(0, 0, 3)]$$
$$\alpha_{2}=[(0, 0, 3) +t(0, 3, 3)]$$
$$\alpha_{3}=[(0, 3, 3) +t(3, 3, 3)]$$
So that the final path is the sum of the previous ones, i.e. $\alpha(t)=[(3t, 3+6t, 6+9t)]$, so we can find the line integral
$$\int f \cdot d\alpha= \int_{0}^{3} f[(3t, 3+6t, 6+9t)] \cdot (3, 6, 9)=\int_{0}^{3} (-3-6t, 3t, 6+9t) \cdot (3, 6, 9) =\frac{999}{2}$$
It may be that the parameterization is not the right one, as I feel that for some values of $t$ the points are outside the cube, any suggestions?
 A: 
From $(0, 0, 0)$ to $(0, 0, 3)$ to $(0, 3, 3)$ to $(3, 3, 3)$, then parameterizing each line segment we have
$$\alpha_{1}=[(0, 0, 0) +t(0, 0, 3)]\\\alpha_{2}=[(0, 0, 3) +t(0, 3, 3)]\\\alpha_{3}=[(0, 3, 3) +t(3, 3, 3)]$$
So that the final path is the sum of the previous ones, i.e. $\alpha(t)=[(3t, 3+6t, 6+9t)]$,

Nope. This is a straight line intercepting $\def\<{\langle}\def\>{\rangle}\<0,0,0\>$ at $t=0$ and $\<3,9,15\>$ at $t=1$.
You require the path to zig-zag to the relevant vertices at $t=1$, $t=2$, and $t=3$.
Thus the path is a piecewise function: $$\begin{align} \alpha(t)&=\begin{cases}\<0,0,0\>+t\<0,0,3\>&:&t\in[0,1)\\\<0,0,3\>+(t-1)\<0,3,0\> &:& t\in[1,2)\\\<0,3,3\> + (t-2)\<3,0,0\> &:& t\in[2,3] \\\text{undef}&:&\text{elsewhen}\end{cases}\\[1ex]&=\begin{cases}\<0,0,3t\>&:&t\in[0,1)\\\<0,3t-3,3\> &:& t\in[1,2)\\\<3t-6,3,3\> &:& t\in[2,3] \\\text{undef}&:&\text{elsewhen}\end{cases}\\[2ex]\dfrac{\mathrm d \alpha}{\mathrm d t}&=\begin{cases}\<0,0,3\> \hspace{17ex}&:& t\in[0,1)\\\<0,3,0\> &:& t\in[1,2)\\\<3,0,0\> &:& t\in[2,3]\\\text{undef} &:& \text{elsewhen}\end{cases}\end{align}$$
