I need to evaluate the following integral: $$\int_{-\infty}^{\infty} e^{tx - 2|x|} dx \tag*{for $t \in (-2, 2)$}$$
To attempt to evaluate this, I being by splitting the integral in two: $$ \int_{-\infty}^{\infty} e^{tx - 2|x|} dx \\ = \int_{-\infty}^{0} e^{tx + 2x} dx + \int_{0}^{\infty} e^{tx - 2x} dx \\ \text{Let }u = tx + 2x\text{, }du = t + 2 dx\\ \text{Let }v = tx - 2x\text{, }dv = t - 2 dx\\ = \int_{-\infty}^{0} \frac{e^{u}}{t + 2} du + \int_{0}^{\infty} \frac{e^{v}}{t - 2} dv \\ = \frac{1}{t + 2}\int_{-\infty}^{0} e^{u} du + \frac{1}{t - 2}\int_{0}^{\infty} e^{v}dv \\ = \frac{1}{t + 2}(1) + \frac{1}{t - 2}\int_{0}^{\infty} e^{tx - 2x} dx \\ $$ At this point I was unsure how to proceed, so I went to Wolfram Alpha to see how it evaluted the integral. Wolfram Alpha gives the following for the indefinite integral: $$ \int e^{tx - 2|x|} dx = \begin{cases} \frac{e^{tx + 2x}}{t + 2} & x < 0 \\ \frac{(t+2)e^{tx - 2x}-4}{t^2 - 4} & x > 0 \\ 0 & x = 0 \end{cases} $$
How do I proceed with evaluating this integral so no integral terms remain, and how does what I've found for the improper integral (if correct) reconcile with Wolfram Alpha's indefinite integral results?
Hint:
$\int\limits_{-\infty}^0e^{tx+2x}dx=\int\limits_{-\infty}^0e^{(t+2)x}=(\dfrac{e^{(t+2)x}}{t+2})\big|_{-\infty}^0=\dfrac{e^{(t+2)\cdot 0}}{t+2}-\lim\limits_{y\to -\infty}\dfrac{e^{(t+2)y}}{t+2}=\dfrac{e^0}{t+2}-0=\dfrac{1}{t+2}$
No need to use substitution because we integrate with respect to $x$. Other integral is evaluated similarly.