is this definite integral correct? I have this definite integral $$ \int^{2}_{1} \frac{e^{1/x}}{x^4}dx$$
this is my attempt:

*

*I used u-substitution. $u = 1/x$, and then $-du = 1/x^2 dx$

*I rewrote $1/x^4$ as $(1/x^2) * (1/x^2)$

*now, I rewrote the integral as $$ -\int^{1/2}_{1} u^2 e^u du$$

*I used integration by parts technique twice, as follows: $g(x) = u^2, \space g'(x) = 2u\space du, \space and \space f(x) = e^u, \space f'(x) = e^u\space du$
$ e^u u^2 - 2\int^{1/2}_{1} e^u u\space du$
the second integration by parts is as follows: $g(x) = u$, $g'(x) = du$, and $f(x) = e^u$, $f'(x) = e^u\space du$
$ e^u u^2 - 2e^u u - \int^{1/2}_{1} e^u\space du$
$ -e^u u^2 + 2e^u u + e^u$

*

*the result is the following:  $-e^u u^2 + 2e^u u+ e^u$ (evaluated  from $u =1$ to $u = 1/2$).

does it make sense? is it correct?
EDIT: perhaps, there's a problem with some signs, because before the integral I've put a minus sign, and because of that I should've changed signs in the result. fixed.
 A: I think you made an algebra mistake when integrating by parts. Starting with
$$\int u^2 e^u \; \mathrm{d}u,$$
your choice of $g = u^2, \mathrm{d}f = e^u\; \mathrm{d}u$ is good. This yeilds
$$\int u^2 e^u \; \mathrm{d}u = u^2 e^u - \int 2 u e^u \; \mathrm{d}u = u^2 e^u - {\color{blue} 2} \int u e^u \; \mathrm{d}u.$$
Next, we focus on $\int u e^u \; \mathrm{d}u$. Like you suggested, we pick $g = u, \mathrm{d} f = e^u \; \mathrm{d}u$. This gives us
$$\int u e^u \; \mathrm{d}u = u e^u - \int e^u \; \mathrm{d}u = ue^u - e^u + c.$$
Putting everything together, we have
$$\int u^2 e^u \; \mathrm{d}u = u^2 e^u - {\color{blue} 2}(ue^u - e^u + c) = e^u(u^2 - 2u + 2) + c.$$
I think you forgot to correctly distribute the factor of ${\color{blue} 2}$, and a minus sign.
A: $$\begin{align}\int_1^2\frac{e^{1/x}}{x^4}dx&\xrightarrow{1/x\to u}-\int_{1}^{1/2}u^2e^udu\\&=\int_{1/2}^1u^2e^udu\\&=u^2e^u\Big|_{1/2}^1-2\int_{1/2}^1ue^udu\\&=u^2e^u\Big|_{1/2}^1-2ue^u\Big|_{1/2}^1+2\int_{1/2}^1e^udu\\&=(u^2-2u+2)e^u\Big|_{1/2}^1\end{align}$$
