1. Split the integral at \(t = k\), where the absolute value changes:
\[
f(x) = \int_{0}^{k} e^{k-t} dt + \int_{k}^{2} e^{t-k} dt.
\]
2. Evaluate the first part of the integral:
\[
\int_{0}^{k} e^{k-t} dt = e^k \int_{0}^{k} e^{-t} dt.
\]
Simplify:
\[
\int_{0}^{k} e^{-t} dt = \left[-e^{-t}\right]_{0}^{k} = 1 - e^{-k}.
\]
Thus:
\[
\int_{0}^{k} e^{k-t} dt = e^k (1 - e^{-k}) = e^k - 1.
\]
3. Evaluate the second part of the integral:
\[
\int_{k}^{2} e^{t-k} dt = e^{-k} \int_{k}^{2} e^{t} dt.
\]
Simplify:
\[
\int_{k}^{2} e^{t} dt = \left[e^t\right]_{k}^{2} = e^2 - e^k.
\]
Thus:
\[
\int_{k}^{2} e^{t-k} dt = e^{-k}(e^2 - e^k) = e^2 e^{-k} - 1.
\]
4. Combine the results:
\[
f(x) = (e^k - 1) + (e^2 e^{-k} - 1).
\]
5. Simplify:
\[
f(x) = e^k + e^2 e^{-k} - 2.
\]
6. To minimize \(f(x)\), let \(z = e^k\), so:
\[
f(x) = z + \frac{e^2}{z} - 2.
\]
Differentiate \(f(x)\) with respect to \(z\):
\[
\frac{df}{dz} = 1 - \frac{e^2}{z^2}.
\]
Set \(\frac{df}{dz} = 0\) to find the critical point:
\[
1 = \frac{e^2}{z^2} \implies z^2 = e^2 \implies z = e.
\]
7. Substitute \(z = e\) back into \(f(x)\):
\[
f(x) = e + \frac{e^2}{e} - 2 = e + e - 2 = 2(e - 1).
\]
Thus, the minimum value of \(f(x)\) is \(2(e - 1)\).
The integral involves an absolute value, so it must be split into two parts based on the point \(t = k\). Simplify each part and minimize the resulting function by treating it as a function of \(z = e^k\).