TITLE: Determine antiderivative of $f$
QUESTION [6 upvotes]: So I have a function:
$$f (t) = \begin{cases}
-1, & \text{if } {-2} \le t \le 0 \\
2 - \sqrt{t^2-6t+9}, & \text{if } 0 < t < 6 \\
-1, & \text{if } 6 \le t \le 8 \\
\end{cases}$$
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 - \vert{t-3}\vert$.
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.

REPLY [2 votes]: First let's be explicit about what you say you already figured out:
$$f (t) = \begin{cases}
-1, & \text{if } {-2} \le t \le 0 \\
t-1, & \text{if } 0<t\le3 \\
5-t, & \text{if } 3 < t < 6 \\
-1, & \text{if } 6 \le t \le 8 \\
\end{cases}$$
$$
F(x) = \left\{ \begin{align} & \int_{-2}^x f(t) \, dt & & \text{if } {-2}\le x \le 0, \\[4pt]
& \int_{-2}^0 f(t)\,dt + \int_0^x f(t)\,dt  & &\text{if } 0\le x \le 3, \\[4pt]
& \int_{-2}^0 f(t)\,dt + \int_0^3 f(t)\,dt + \int_3^x f(t)\,dt & & \text{if } 3\le x \le 6, \\[4pt]
& \text{and so on.} \end{align} \right.
$$
Note that here I've written $\text{“}{\le}\text{''}$ rather than $\text{“}{<}\text{''}$ since altering the value of $f$ at isolated points does not affect the integral.