Solution (source code)

= Solution
{c}

With $w_s=1/\pi_{n,s}(x_s)$, the <Lagrange interpolation polynomial> can be written, away from its nodes,
$$
p_n(x)=\pi_n(x)\sum_{s=0}^n\frac{w_su_s}{x-x_s}.
$$
Apply the same formula to the constant data $u_s=1$. Uniqueness of <polynomial interpolation> gives $\sum_s\ell_s=1$, and hence
$$
1=\pi_n(x)\sum_{s=0}^n\frac{w_s}{x-x_s}.
$$
Divide the two identities to obtain the <barycentric interpolation formula>
$$
\boxed{p_n(x)=
\frac{\displaystyle\sum_{s=0}^nw_su_s/(x-x_s)}
{\displaystyle\sum_{s=0}^nw_s/(x-x_s)}.}
$$
At $x=x_r$, use the continuous limiting value $u_r$. Multiplying every weight by the same nonzero constant cancels between numerator and denominator, so only relative weights are needed in computation.