For what values of $a$ $\int^2_0 \min(x,a)dx=1$ I want to check for what values of $a$ the integral of this function is equal to $1$
$$\int^2_0 \min(x,a)dx=1$$
What I did is to check 2 cases and I am not sure is enough :
case 1: 
$$a<x \rightarrow \int^2_0 a = ax|^{2}_{0}=2a=1 \rightarrow a=\frac{1}{2}$$
now I dont know if its enough so say that, I need to check if $a<2$? or what I did?

case 2:
$$a>x \rightarrow \int^2_0 x = \frac{x^2}{2}|^{2}_{0}=2$$
how I need to continue from here?
Thanks!

Note that $0 \le x \le 2$. Thus, you have considered two cases: when $a<0$ and when $a>2$. It remains to check when $0\le a\le2$. Hence, we split the given integral into the following two integrals:
$$ \begin{align*}
1 &= \int_0^a \min(x,a)dx + \int_a^2 \min(x,a)dx \\
1 &= \int_0^a xdx + \int_a^2 adx \\
1 &= \left[\dfrac{x^2}{2} \right]_0^a + \left[ax \right]_a^2 \\
1 &= \left[\dfrac{a^2}{2} -0\right] + \left[2a-a^2 \right] \\
1 &= \dfrac{-1}{2}a^2+2a \\
2 &= -a^2+4a \\
a^2-4a+4 &= 2 \\
(a-2)^2 &= 2 \\
a-2 &= \pm\sqrt{2} \\
a &= 2 \pm \sqrt{2} \qquad (\approx 0.58579 \text{ or } 3.4142)\\
\end{align*}$$
Hence, since we know that $0 \le a \le 2$, we reject the larger solution and conclude that:

$$
a=2-\sqrt{2}=0.58579...
$$

