doesn't this work? (I might be missing something.)

```
denom = (a2*b1 - a1*b2).subs(coeff_dict)
```