# Finding the constant of integration

Let $f(x)=\begin{array}{l}\left\{\begin{array}{c}x,\;x\in(-\infty,0)\\x^2,\;x\in\lbrack0,2)\\2x,\;x\in\lbrack2,+\infty)\end{array}\right.\\\\\end{array}$. Find the primitive of $F(x)$ of $f(x)$ in $\mathbb{R}$.

Easy, we have:

$$F(x)=\begin{array}{l}\left\{\begin{array}{c}\frac{x^2}2\;+\;c_1,\;x\in(-\infty,0)\\\frac{x^3}3+c_2,\;x\in\lbrack0,2)\\x^2+c_3,\;x\in\lbrack2,+\infty)\end{array}\right.\\\\\end{array}$$

Now, How do I find $c_1,c_2,c_3$? Do I find them just from the continuity of $F(x)$? From that we might get $c_1=c_2$ and $4+c_3= \frac 83 + c_2$. But still can't find them just from that... Can I find the constants of integration just with this data?

You are right from the continuity of $F$ you obtain two equations: $$c_1=c_2$$ $$4+c_3=\frac{8}{3}+c_2$$ the fact that $c_1,c_2,c_3$ are not entirely determined is predictable:
If $F$ is a primitive so is $F+c$, i.e if $c_1,c_2,c_3$ are solutions so are $c_1+c,c_2+c,c_3+c$.
And indeed the solutions are: $$c_1=t$$ $$c_2=t$$ $$c_3=t-\frac{4}{3}$$ for any $t \in \Bbb R$.