Undoubtedly, this question is so easy but I'd like to ask it. We know that the way in which the indefinite integrals like $\int P(x)e^{ax}dx$ and $\int P(x)\sin(bx)dx$ wherein $P(x)$ is an arbitrary polynomial of $x$ and $a, b\in \mathbb R$ are evaluated is Integrating by Parts $\int udv=uv-\int vdu$.
So we should take $u$ and $dv$ frequently until the whole integral becomes an easy integral. Is there any fast method in which we can do above integrals without using the classic formula? Thank you for the help.
I know two tricks. For the $\sin(bx)$ type of integral, notice that $P(x)\sin(bx)$ is the imaginary part of $P(x)e^{ibx}$, which you can integrate more easily and then extract the imaginary part.
For the $e^{ax}$ type, notice that $x^ne^{ax} = \frac{\partial^n}{\partial a^n}(e^{ax})$. So then $$\int x^n e^{ax}dx = \int \frac{\partial^n}{\partial a^n}e^{ax}dx = \frac{\partial^n}{\partial a^n} \int e^{ax} dx$$ $$$$ $$ = \frac{\partial^n}{\partial a^n}\left(\frac{1}{a}\right) = \frac{(-1)^n}{n! a^{n+1}}$$if you're integrating from 0 to infinity.