<s>[INST] Need help to solve taylor series of $e^{\sin x}$ How to derive the taylor series of $e^{\sin x}$, up to $x^5$?
i just don't know how to get the answer
$$f(x) = 1 + x + \frac{x^2}{2} - \frac{x^4}{8} -\frac{x^5}{15}$$
really need some help. Thanks
 [/INST] Let $f(x) = e^{\sin x}$.
\begin{equation*}
\begin{split}
f'(x) &= e^{\sin x} \cos x = f(x) \cos x\\
f''(x) &= f'(x) \cos x - f(x) \sin x \\
f'''(x) &= f''(x) \cos x - f'(x)\sin x - (f(x)\cos x + f'(x) \sin x)\\
&= f''(x) \cos x - 2f'(x) \sin x - f'(x)\\
f^4 (x) &= f'''(x) \cos x - f''(x) \sin x - 2(f'(x)\cos x + f''(x)\sin x) - f''(x)\\
&= f'''(x) \cos x - 3f''(x) \sin x - 2f'(x) \cos x - f''(x)
\end{split}
\end{equation*}
Calculating higher order derivatives at $x=0$,
\begin{equation*}
\begin{split}
f(0) &= 1\\
f'(0) &= 1 \times 1 = 1\\
f''(0) &= 1 - 0 = 1\\
f'''(0) &= 1-0-1 = 0 \\
f^4 (0) &= 0 - 0 -2 -1 = -3\\
f^5 (0) &= f^4 (0) \cos 0 - 3 f''(0) \cos 0 - 2f''(0) \cos 0- f'''(0)\\
&= - 3 -3-2-0 =-8
\end{split}
\end{equation*}
Using Maclaurin's expansion for infinite series,
\begin{equation*}
\begin{split}
f(x) &= f(0) + xf'(0) + \frac{x^2}{2!}f''(0) + \frac{x^3}{3!}f'''(0) + \\
     &  \frac{x^4}{4!}f^4 (0) + \frac{x^5}{5!}f^5 (0) + \frac{x^6}{6!}f^6 (0) +  \ldots\\
e^{\sin x} &= 1 + x + \frac{x^2}{2!}\times 1 + 0 + \frac{x^4}{4!}\times (-3) + \frac{x^5}{5!} \times (-8) \ldots\\
&= 1 + x + \frac{x^2}{2} - \frac{x^4}{8} - \frac{x^5}{15} \ldots\\
\end{split}
\end{equation*}
</s>