Solution (source code)

= Solution

After adjusting for $X_1$, the $X_2$ coefficient is the total causal effect of $X_2$ on $Y$, consisting of $X_2\to Y$ and $X_2\to X_3\to Y$. The $X_1$ coefficient is the causal effect of $X_1$ with $X_2$ held fixed: it retains paths not passing through $X_2$, namely the direct path and $X_1\to X_3\to Y$.