Calculate derivative of integral I tried to calculate the derivative of this integral:
$$\int_{2}^{3+\sqrt{r}}  (3 + \sqrt{r}-c) \frac{1}{2}\,{\rm d}c $$
First I took the anti-derivative of the integral:
$$\frac{1}{2}\left(\frac{-c^2}{2}+c\sqrt{r}+3c\right)$$
Then I evaluated the integral:
$$-\frac{1}{2}\left(\frac{3+\sqrt{r})^2}{2} + (3 + \sqrt{r})\sqrt{r}+3(3+\sqrt{r})\right)-\frac{1}{2}\left(-\frac{(2^2)}{2}+2\sqrt{r}+3\cdot 2\right)$$
After I simplified I got:
$$\frac{1 + 2\sqrt{r}+r}{4}$$
I should get:
$$\frac{1 + \sqrt{r}}{4\sqrt{r}}$$
But I cannot get this result.
Can someone help? what am I missing?

As it appears the derivative is taken with respect to $r$. The integral in question is given by, and evaluated as, the following:
\begin{align}
I(r) &= \frac{1}{2} \, \int_{2}^{3+\sqrt{r}} (3 + \sqrt{r} - t) \, dt \\
&= \frac{1}{2} \, \left[ (3 + \sqrt{r}) t - \frac{t^{2}}{2} \right]_{2}^{3 + \sqrt{r}} \\
I(r) &= \frac{(3 + \sqrt{r})^{2}}{4} - (2 + \sqrt{r}).
\end{align}
Now by differentiation 
\begin{align}
\frac{dI}{dr} &=  \frac{2}{4} \cdot (3 + \sqrt{r}) \cdot \frac{1}{2 \sqrt{r}} - \frac{1}{2 \sqrt{r}} \\
&= \frac{3 + \sqrt{r}}{4 \sqrt{r}} - \frac{1}{2 \sqrt{r}} = \frac{1 + \sqrt{r}}{4 \, \sqrt{r}}.
\end{align}
