Question: The question is easy to phrase:

Show that
$$
\int\_{-\infty}^{\infty} e^{-x^2 + 2x} dx
$$
converges and compute its value.

A first thing I did is simplifying it to $\int\_{-\infty}^{\infty} e^{-y^2 + 1} dy $. Now it is also symmetric along zero so calculating it on $[0, \infty)$ is enough.

Then I started looking for an antiderivative in numerous ways, but without succes. For example if I try deriving $f(y)e^{-y^2 + 1}$ for a so far unspecified function $f$, I get
$$
d \left(f(y)e^{-y^2 + 1}\right)/dy = f'(y)e^{-y^2 +1} - 2y \cdot f(y) e^{-y^2 + 1}
$$
using the product rule, but I couldn't find a solution to the differential equation $f' -2yf = 1$...

A hint should be fine so I can figure out the rest myself. This question is part of an entrance exam for a PhD program of some years ago. I will be taking the exam this year, so it is not so much about this particular question, but more about the general methods to tackle such questions. So if the answer could be somehow phrased for general such questions that would be great.

Answer: 
You should be aware (see kobe's answer) that 
$$\int\_{-\infty}^\infty e^{-x^2}\,dx=\sqrt\pi.$$

Now, 
$$\begin{align}
\int\_{-\infty}^\infty e^{-x^2+2x}\,dx& = \int\_{-\infty}^\infty e^{-x^2+2x-1}e\,dx\\
& =e\int\_{-\infty}^\infty e^{-(x-1)^2}\,dx\\
& =e\int\_{-\infty}^\infty e^{-t^2}\,dt\quad\quad\quad t=x-1\\
& =e\sqrt\pi.
\end{align}$$
Not sure what to make of it, but here is some fun insight for 'Feynman integration' or integration under the differentiation sign.
$$
\begin{align}
f(a)&=\int\_{-\infty}^{\infty} e^{-x^2 + ax} dx\\
f'(a)&=a\int\_{-\infty}^{\infty} e^{-x^2 + ax} dx\\
\implies f'(a)&=af(a)\\
\implies\frac{f'(a)}{f(a)}&=a\\
\implies \log f(a)&=\frac{a^2}{2}+c\\
\implies f(a) &= e^{a^2/2+c}\\
f(2)&=e\ e^{c+1}\\
\implies c&=\log\sqrt\pi-1
\end{align}
$$