Suppose $L$ is the generator of a continuous contraction semigroup $P_t$ on $E$ and $f:\R_0^+\rar E$ is a $C^1$ curve in $E$. Verify that the unique solution of the inhomogeneous equation $$ \ttd tu(t)=f(t)+Lu(t) \quad u(0)=x\in\dom L $$ is given by Duhamel's formula: $$ u(t)=P_tx+\int_0^tP_{t-s}f(s)\,ds~. $$
Put $h(t)\colon=\int_0^tP_{t-s}f(s)\,ds$, then $u(t)=P_tx+h(t)$ solves the inhomogeneous equation iff $h^\prime(t)=Lh(t)+f(t)$. Thus we need to show that $h$ is a differentiable $\dom L$-valued curve and its derivative is given by $Lh(t)+f(t)$. Now $$ h(t)=\int_0^tP_{t-s}f(s)\,ds=\int_0^t P_sf(t-s)\,ds $$ and thus by the proof of proposition $h$ is a differentiable $\dom L$-valued curve. Moreover \begin{eqnarray*} h(t+r)-h(t) &=&\int_0^{t+r}P_{t+r-s}f(s)\,ds-\int_0^t P_{t-s}f(s)\,ds\\ &=&(P_r-1)\int_0^tP_{t-s}f(s)\,ds+P_r\int_t^{t+r}P_{t-s}f(s)\,ds \end{eqnarray*} and since $h(t)\in\dom(L)$ we conclude that: $h^\prime(t)=Lh(t)+f(t)$.
Uniqueness: If $u,v$ are different solutions, then $w\colon=u-v$ solves the homogeneous equation $w^\prime(t)=Lw(t)$ and $w(0)=0$, i.e. by uniqueness of solutions of the homogeneous equation: $w=0$.