Solution 2. The left side of Exercise 1 is a function of \(\eta\) alone, and its derivative is
\[
\begin{aligned}
\frac{d {\operatorname{exp}\mathopen{}\left\{{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}}}{d \eta}
&= {\operatorname{exp}\mathopen{}\left\{{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \, \frac{d {A\mathopen{}\left(\eta\right)\mathclose{}}}{d \eta}
&& \text{(chain rule)}
\end{aligned}
\]
The derivative of the right side moves inside the integral, where only the exponential function depends on \(\eta\):
\[
\begin{aligned}
\frac{d }{d \eta} \int {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx
&= \int {{h\mathopen{}\left(x\right)\mathclose{}}} \, \frac{d {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}}}{d \eta} \, dx
&& \text{(the derivative of the integral is the integral of the derivative)}\\
&= \int {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, {T\mathopen{}\left(x\right)\mathclose{}} \, dx
&& \text{(chain rule)}\\
&= \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(multiplication is commutative)}
\end{aligned}
\]
The two derivatives are equal, because the two sides of Exercise 1 are equal:
\[
{\operatorname{exp}\mathopen{}\left\{{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \, \frac{d {A\mathopen{}\left(\eta\right)\mathclose{}}}{d \eta}
= \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx.
\]
Solving for the derivative of the log-partition function:
\[
\begin{aligned}
\frac{d {A\mathopen{}\left(\eta\right)\mathclose{}}}{d \eta}
&= \frac{1}{{\operatorname{exp}\mathopen{}\left\{{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}}} \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(divide both sides by } {\operatorname{exp}\mathopen{}\left\{{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \text{)}\\
&= {\operatorname{exp}\mathopen{}\left\{-{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(the reciprocal of an exponential is the exponential of the negative)}\\
&= \int {\operatorname{exp}\mathopen{}\left\{-{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \, {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(a factor free of the integration variable moves into the integral)}\\
&= \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}}\right\}\mathclose{}} \, {\operatorname{exp}\mathopen{}\left\{-{A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(multiplication is commutative)}\\
&= \int {T\mathopen{}\left(x\right)\mathclose{}} \, {{h\mathopen{}\left(x\right)\mathclose{}}} \, {\operatorname{exp}\mathopen{}\left\{\eta\, {T\mathopen{}\left(x\right)\mathclose{}} - {A\mathopen{}\left(\eta\right)\mathclose{}}\right\}\mathclose{}} \, dx
&& \text{(the product of exponentials is the exponential of the sum)}\\
&= \int {T\mathopen{}\left(x\right)\mathclose{}} \, \mathbb{f}\mathopen{}\left(x; \eta\right)\mathclose{} \, dx
&& \text{(definition of an exponential family)}\\
&= {\mathbb{E}\mathopen{}\left[{T\mathopen{}\left(X\right)\mathclose{}}\right]\mathclose{}}
&& \text{(definition of the expectation)}
\end{aligned}
\]