Determine antiderivative of f.

So I have a function:

$f(t)=\{\begin{array}{ll}-1,& \text{if}-2\le t\le 0\\ 2-\sqrt{{t}^{2}-6t+9},& \text{if}0t6\\ -1,& \text{if}6\le t\le 8\end{array}$

I need to find the antiderivative of f(t) on the interval: $-2<t<8$.

And I need to investigate whether the antiderivative has a maximum value on the interval.

So far I've figured out that the second function $2-\sqrt{{t}^{2}-6t+9}$ can be described as an absolute value: $2-|t-3|$.

That makes it 4 different functions in total that describes f(t)

However, I'm not sure exactly how to formulate a function for the antiderivative on the given interval.

So I have a function:

$f(t)=\{\begin{array}{ll}-1,& \text{if}-2\le t\le 0\\ 2-\sqrt{{t}^{2}-6t+9},& \text{if}0t6\\ -1,& \text{if}6\le t\le 8\end{array}$

I need to find the antiderivative of f(t) on the interval: $-2<t<8$.

And I need to investigate whether the antiderivative has a maximum value on the interval.

So far I've figured out that the second function $2-\sqrt{{t}^{2}-6t+9}$ can be described as an absolute value: $2-|t-3|$.

That makes it 4 different functions in total that describes f(t)

However, I'm not sure exactly how to formulate a function for the antiderivative on the given interval.