Solve equations with different bases (#510)