Problem 20-9 in Lee's Introduction to Smooth Manifolds (2nd Ed.) asks to prove that for a Lie group $G$, and for $X, Y\in \text{Lie}(G)=\mathfrak g$, there is $\epsilon>0$ and a smooth map $Z:(-\epsilon, \epsilon)\to \mathfrak g$ such that $$(\exp tX)(\exp tY) = \exp\left(t(X+Y) + \frac{1}{2}t^2[X, Y] + t^3 Z(t)\right)$$
What we want to show is that the first and second term in the Taylor expansion of $\exp^{-1}\left((\exp tX)(\exp tY)\right)$ are $t(X+Y)$ and $\frac{1}{2}t^2[X, Y]$ respectively.
Calculating the first term is easy since we just need to differentiate $\exp^{-1}((\exp tX)(\exp tY))$ with respect to $t$ at $t=0$ once, and this gives the desired result.
But for the second term we need to take the second derivative at which I am stuck.
At the second order for the left hand side
$$\begin{split}e^{tX}e^{tY}&=(1+tX+\frac{t^2}{2} X^2)(1+tY+\frac{t^2}{2}Y^2)\\ &=1+t(X+Y)+\frac{t^2}{2}(2XY+X^2+Y^2)\end{split}$$
At the second order, we rewrite the right hand side as
$$\begin{split}e^{t(X+Y)+\frac{t^2}{2}f(X,Y)}&=1+t(X+Y)+\frac{t^2}{2}f(X,Y)+\frac{t^2}{2}(X+Y)^2\\ &=1+t(X+Y)+\frac{t^2}{2}f(X,Y)+\frac{t^2}{2}(X^2+XY+YX+Y^2)\end{split}$$
Equating both sides, you find
$$2XY+X^2+Y^2=f(X,Y)+X^2+XY+YX+Y^2$$
So you arrive to
$$f(X,Y)=XY-YX=[X,Y]$$