<s>[INST] Show $\int_{\max\{0,1-c/x\}}^1(1-v)\,dv=\frac{1}{2}\min\{c/x,1\}^2$ Let $c,x\in [0,\infty)$. Using $-\max\{a,b\}=\min\{-a,-b\}$ we get
\begin{align}
\int_{\max\{0,1-c/x\}}^1(1-v)\,dv&= 1-\max\{0,1-c/x\}-\left(\frac{1}{2}-\frac{1}{2}\max\{0,1-c/x\}^2\right)\\
&=\frac{1}{2}-\max\{0,1-c/x\}+\frac{1}{2}\max\{0,1-c/x\}^2\\
&= \frac{1}{2}+\min\{0,c/x-1\}+\frac{1}{2}\min\{0,c/x-1\}^2 \\
&=\min\left\{\frac{1}{2},c/x-\frac{1}{2}\right\}+\frac{1}{2}\min\{0,c/x-1\}^2
\end{align}
How do I get to $\frac{1}{2}\min\{c/x,1\}^2$?
 [/INST] \begin{align*}
&=\frac{1}{2}\left(1+2\min(0,c/x-1)+\min(0,c/x-1)^2\right) \\
&=\frac{1}{2}\left(1+\min(0,c/x-1)\right)^2 \\
&=\frac{1}{2}\min(1,c/x)^2
\end{align*}
</s>