How do I solve this integral via integration by parts when it shows a recursion-like behavior? I've come across an integral while solving a question for ODE's. The integral is as follows:
$$\int e^{-2x}x\,dx$$
From here I set:
$$
\begin{align}
f(x) = e^{-2x}\quad & f'(x) = -2e^{-2x} \\
g(x) = \frac{1}{2}x^2\quad & g'(x) = x
\end{align}
$$
and continued to solve the integral as follows:
\begin{align}
\int e^{-2x}x\,dx & = e^{-2x}x - \int \left(-2e^{-2x} \times \frac{1}{2}x^2\right)\,dx \\
& = e^{-2x}x + \int \left( e^{-2x}x^2 \right)\,dx
\end{align}
Solving this integral yields:
$$
\int e^{-2x}x\,dx = e^{-2x}x + \frac{2}{3}\int e^{-2x}x^3\,dx
$$
and it continues like this.
How should I proceed to solve this integral? Any tips or advice is greatly appreciated.
 A: Your working is correct, but the way you're using IBP is not helping you to get to the answer.
If I asked you to "solve $2x = 4$", you could add $3$ to both sides then times both sides by $50$, but that wouldn't help get to the answer (find x). That's what you're doing here. You're not using the formula in the intended way in order to get to the answer.
Have a look at the formula at the top of:
https://en.wikipedia.org/wiki/Integration_by_parts
With IBP, you're meant to choose $v^\prime(x)$ and $u(x)$ in a way that the integral "reduces" to something "simpler" at each stage, so that eventually you "reduce" the initial integral to an integral you are more familiar with.
So you chose $u(x) =$ the exponential part and $v^\prime(x) = x$
Try it the other way round. Choose $u(x) = x$ and $v^\prime(x) =$ the exponential part.
Because $v^\prime(x)$ goes to $v(x)$, that's basically integrating $v^\prime(x)$ and carrying it over to both terms on the RHS of the equation.
The $u(x)$ gets differentiated on the RHS, and $d/dx(x) = 1$, which gets you a "simpler" integral.
Usually when you have a polynomial and something else in the original integral, you should choose the polynomial $= u(x)$ because then it gets "reduced down" when integrating by parts.
A: Let $u=x$ and $dv=e^{-2x}dx$. Then, $du=dx$ and $v=\dfrac{e^{-2x}}{-2}$
$$\int e^{-2x}xdx=-\frac{xe^{-2x}}{2}+\frac{1}{2}\int e^{-2x}dx=-\frac{xe^{-2x}}{2}-\frac{e^{-2x}}{4}+C=-\frac{e^{-2x}}{4}\left(2x+1 \right)+C$$
A: With $$u=x,v'=e^{-2}$$ we get $$u'=1,v=-\frac{1}{2}e^{-2x}$$ we get
$$\int xe^{2x}dx=-x\frac{1}{2}e^{-2x}-\int\frac{-1}{2}e^{-2x}dx$$
