Solve $ \int_0^\infty x^n e^{-\lambda x} dx $ by differentiating under integral sign

calculusderivativesintegration

I have only found information regarding doing this by integration by parts. By differentiating under the integral sign, I let
$$I_n = \int_0^\infty x^n e^{-\lambda x} dx $$
and get $\frac{dI_n}{d\lambda} = -I_{n+1} $ and therefore $\frac{dI_n}{d\lambda} = -\frac{n+1}{\lambda} I_n$. Proceeding from here I solve the ODE to get $I_n = Ae^{-\frac{n+1}{\lambda}x}$.

This is clearly wrong. What went wrong? I am unsure how to proceed with this differentiation of the integral approach to solve this problem.

Best Answer

Differentiate under the integral sign $n$ times as follows $$\int_0^\infty x^n e^{-\lambda x} dx=(-1)^n\frac{d^n}{d\lambda^n} \int_0^\infty e^{-\lambda x} dx= (-1)^n\frac{d^n}{d\lambda^n}\frac1\lambda=\frac{n!}{\lambda^{n+1}} $$