I want to find $$\mu_r' = \int_0^\infty y^r\theta e^{-\theta y}dy $$
A day ago I read something here on MSE about differentiation under the integral sign. I am not sure of how it works, however I tried to differentiate wrt $r$ for $r$ times, but I just get a huge expression. Considering $\theta e^{-\theta y}$ a constant wrt $r$ I get first $ry^{r-1}$ then $y^{r-1}+r(r-1)y^{r-2}$ then $(r-1)y^{r-2}+(r-1)y^{r-2}+(ry^{r-2}+r(r-1)(r-2)y^{r-3})$ and so on.
I can see there must be a pattern, but I can't find it. How can I find the general formula for $\mu_r'$ ?
Edit
I am pretty sure that the solution is something of the form $$\frac{r!}{\theta^r}$$ as this is what you get when doing each case separately
Edit 2
As seen in the answers below my derivative is wrong, still I have no clue on how to solve the problem
You are confusing the derivative with respect to $r$ and $y$ since
$$\frac{d}{dy} y^{r} = r y^{r-1}$$
and
$$\frac{d}{dy^n} y^{r} = r (r-1) \cdots (r-(n-1)) y^{r-n}$$
While the nth derivative with respect to $r$ is
$$\frac{d}{dr^n} y^{r} = \log^n(y) y^{r}$$
To solve the integral
$$ \int_0^\infty y^r\theta e^{-\theta y}dy $$
Now let $\theta y = r$
$$ \frac{1}{\theta^{r}}\int^\infty_0 x^r e^{-x}\,dx $$
Now use integration by parts
$$f(r) = \int^\infty_0 x^r e^{-x}\,dx = r\int^\infty_0 x^{r-1} e^{-x}\,dx$$
This implies $f(r) = rf(r-1)$ which is the definition of the factorial for $r > 0$ , hence $f(r) = r!$ .
This implies
$$ \int_0^\infty y^r\theta e^{-\theta y}dy = \frac{r!}{\theta^r} $$