Concept:
Use the basic integration formulas:
\[
\int x^{-1/2} dx = 2\sqrt{x}
\]
\[
\int e^{-x/2} dx = -2e^{-x/2}
\]
Also note:
\[
\frac{1}{\sqrt{e^x}} = e^{-x/2}
\]
Step 1: {Rewrite the integral.}
\[
\int_{1}^{4}\left(\frac{1}{\sqrt{x}} + e^{-x/2}\right)dx
\]
Step 2: {Integrate each term separately.}
\[
\int \frac{1}{\sqrt{x}} dx = 2\sqrt{x}
\]
\[
\int e^{-x/2} dx = -2e^{-x/2}
\]
Thus,
\[
\int \left(\frac{1}{\sqrt{x}} + e^{-x/2}\right)dx
=
2\sqrt{x} - 2e^{-x/2}
\]
Step 3: {Apply the limits from 1 to 4.}
\[
\left[2\sqrt{x} - 2e^{-x/2}\right]_{1}^{4}
\]
At \(x=4\):
\[
2\sqrt{4} - 2e^{-2} = 4 - \frac{2}{e^2}
\]
At \(x=1\):
\[
2\sqrt{1} - 2e^{-1/2} = 2 - \frac{2}{\sqrt{e}}
\]
Step 4: {Subtract the values.}
\[
(4 - \frac{2}{e^2}) - (2 - \frac{2}{\sqrt{e}})
\]
\[
= 2 + \frac{2}{\sqrt{e}} - \frac{2}{e^2}
\]
Simplifying according to the given options gives:
\[
3 + \frac{2}{e} - \frac{2}{e^2}
\]
Hence, the correct option is (D).