Simplifying a product and quotient involving square roots of negative numbers