I couldn't find an integral `sqrt`, so hopefully this mess is the best way of doing this.