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!
 A: There's three cases:


*

*If $a\leq 0$ then
$$\int^2_0 \min(x,a)dx=a\int_0^2 dx=2a\neq 1\forall a$$

*If $a\geq 2$ then
$$\int^2_0 \min(x,a)dx=\int_0^2 xdx=2\neq 1\forall a$$

*If $0<a<2$ then
$$\int^2_0 \min(x,a)dx= \int_0^a xdx+a\int_a^2dx\\=\frac{a^2}{2}-a^2+2a=-\frac{a^2}{2}+2a=1\iff 0<2-\sqrt 2<2\ \text{or}\ 2-\sqrt 2\notin(0,2)   $$


so the desired value of $a$ is $2-\sqrt 2$
A: It is not entirely correct to look at the cases like you did since the function you integrate depends on $x$. 
The function we look at is $f_a(x)= \min(a,x)$ where $a$ is some fixed number and $x$ varies in the interval $(0,2)$, which leads to the three cases. 
Case 1 $a\leq0$
$\qquad $ In this case $f_a(x)=a$ for all $x\in(0,2)$. 
$\qquad $ What does that say about the equation 
$$\int_0^2f_a(x)dx=1 ?$$
Case 2 $a$ is some number with $0<a<2$
$\qquad $ In this case 
$$f_a(x)=\Big\{\array{x &\quad\text{for all $x\in(0,a)$}\\a&\quad\text{for all $x\in(x,2)$}}$$ 
$\qquad $ What does that say about the equation 
$$\int_0^2f_a(x)dx=1 ?$$
Case 3 $a\geq2$ 
$\qquad $ In this case 
$f_a(x)=x$ for all $x\in(0,2)$.
$\qquad $ What does that say about the equation 
$$\int_0^2f_a(x)dx=1 ?$$
A: Assuming $0 \leq a \leq 2$ since other cases does not apply...
$$
\int^2_0 \min(x,a)dx = \int^a_0 x dx + \int^2_a adx = \frac{a^2}2 +  a(2-a) 
$$
The equation to solve is then
$$
\frac{a^2}2 +  a(2-a) = 1
$$
which gives
$$
a^2 -4a + 2 = 0   
$$
The solutions for $a$ are 
$$
a = \frac{4 \pm \sqrt{8}}{2} = 2 \pm \sqrt{2}
$$
and we omit the solution larger than $2$.
A: 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...
$$

