<s>[INST] McLaurin expansion for $f(x)=e^{\sin{x}}$ of the 4:th order. By the 4:th order, they mean using the 4:th derivative. But the differentiation gets a bit ugly quite fast, so instead of computing all the derivatives , I should be able to use the standard expansions:
$$e^t=1+t+\frac{t^2}{2!}+\frac{t^3}{3!}+B(t) \\ \sin{x}=x-\frac{x^3}{3!}+B(x),$$
Where $B(t),B(x)$ are functions that are bounded close to $x=0.$ Correct me if I'm wrong, but both of the expansions above are of 4:th order since for the sine function we have two terms vanishing because they become zero?
I'm not sure how I should fuse the separate expansions of $e^t$ and $\sin{x}$ to one expansion. Setting $t=\sin{x}$ seems to give me an expression tedious tedious to work with.
 [/INST] You already have
$$e^t=1+t+\frac{t^2}{2!}+\frac{t^3}{3!}+\frac{t^4}{4!}+O(t^5)$$
and
$$\sin{x}=x-\frac{x^3}{3!}+O(x^5),$$
So just substitute:
$$e^{\sin x} = 1 + \left(x-\frac{x^3}{3!}+O(x^5)\right) + \frac{1}{2!}\left(x-\frac{x^3}{3!}+O(x^5)\right)^2 \\+ \frac{1}{3!}\left(x-\frac{x^3}{3!}+O(x^5)\right)^3 +\frac{1}{4!}\left(x-\frac{x^3}{3!}+O(x^5)\right)^4 + O\left(\left(x-\frac{x^3}{3!}+O(x^5)\right)^5\right)\\
=1 + \left(x-\frac{x^3}{3!}\right) + \frac{1}{2!}\left(x^2-2\frac{x^4}{3!}\right) + \frac{1}{3!}\left(x^3\right) +\frac{1}{4!}\left(x^4\right) + O\left(x^5\right).$$
Gather like terms and bob's your uncle.
$$e^{\sin x} = 1 + x + \frac{x^2}{2!}  -\frac{x^3}{3!}+\frac{x^3}{3!} -2\frac{1}{2}\frac{x^4}{3!}+\frac{x^4}{4!}+O(x^5)\\=1 + x + \frac{x^2}{2!} - \frac{x^4}{8}+O(x^5).$$
</s>