I know that if f(x) is an even function then there's a formula involving the sum of residues to compute the improper integral. But how then would you solve something like $\int_{-\infty}^{\infty} \frac{dx}{x^{2} + 2x + 5}$? Because here f(x) isn't even. I don't really know where to start and can't find relevant examples online or in my textbook.
(Not a homework question - I'm studying for a final).
The fact that $f$ is not even is irrelevant. Even-odd symmetries would be important when computing an integral on $[0, \infty)$, for example.
The function $(x^2 + 2x + 5)^{-1} = \big((x + 1)^2 + 4\big)^{-1}$ has a pole in the upper half plane at $-1 + 2i$ with residue $1/4i$.
Thus the integral over a contour $C_R$ consisting of the segment $[-R, R]$ together with a semicircle connecting the endpoints is
$$\int_{C_R} \frac{1}{z^2 + 2z + 5} \, dz = 2\pi i \cdot \frac 1 {4i} = \frac {\pi}{2}.$$
The decay over the semicircle is easy to handle, and so the original integral is $\pi/2$.
This can also be done easily with real variable techniques, because after an easy change of variables we have $\frac 1 2 \int_{-\infty}^{\infty} \frac 1 {x^2 + 1} \, dx$.