Solution (source code)

= Solution

Each Cartesian component of $a\mathbf r$ contributes $a$ to the <divergence>, while the constant vector contributes zero. Hence
$$
\boxed{\nabla\cdot(a\mathbf r-\mathbf b)=3a}.
$$