Answer: \(\mathrm{e}^{\left(\frac{1}{x+2}\right)}=\mathrm{e}^{\frac12}-\frac14\mathrm{e}^{\frac12}x+\frac{5}{32}\mathrm{e}^{\frac12}x^2\)
Let \(f(x)=\mathrm{e}^{\left(\frac{1}{x+2}\right)}\).
The Maclaurin series up to the term in \(x^2\) is
\(f(x)=f(0)+f'(0)x+\frac{f''(0)}{2}x^2\).
First differentiate:
\(f'(x)=\mathrm{e}^{(x+2)^{-1}}\cdot \frac{d}{dx}\big((x+2)^{-1}\big)=-(x+2)^{-2}\mathrm{e}^{(x+2)^{-1}}\).
Differentiate again using the product rule:
\(f''(x)=2(x+2)^{-3}\mathrm{e}^{(x+2)^{-1}}+(-(x+2)^{-2})\big(-(x+2)^{-2}\mathrm{e}^{(x+2)^{-1}}\big)\)
so
\(f''(x)=2(x+2)^{-3}\mathrm{e}^{(x+2)^{-1}}+(x+2)^{-4}\mathrm{e}^{(x+2)^{-1}}\).
Now evaluate at \(x=0\):
\(f(0)=\mathrm{e}^{1/2}\),
\(f'(0)=-(2)^{-2}\mathrm{e}^{1/2}=-\frac14\mathrm{e}^{1/2}\),
\(f''(0)=2(2)^{-3}\mathrm{e}^{1/2}+(2)^{-4}\mathrm{e}^{1/2}=\frac14\mathrm{e}^{1/2}+\frac1{16}\mathrm{e}^{1/2}=\frac5{16}\mathrm{e}^{1/2}\).
Substitute into the Maclaurin formula:
\(f(x)=\mathrm{e}^{1/2}-\frac14\mathrm{e}^{1/2}x+\frac{1}{2}\cdot\frac5{16}\mathrm{e}^{1/2}x^2\).
Hence
\(\mathrm{e}^{\left(\frac{1}{x+2}\right)}=\mathrm{e}^{\frac12}-\frac14\mathrm{e}^{\frac12}x+\frac{5}{32}\mathrm{e}^{\frac12}x^2\).