Solving equations with exponents and powers