Solving quadratic equations with variable exponents