DGS Studio

Integer Solutions

Powers of Two

The integer solutions of 2^x + 2^y = 12 are (x, y) = (2, 3) and (3, 2). Both give x + y = 5.

solve(2^x + 2^y = 12, x, y, domain=integers) asks for every integer pair. A negative exponent is impossible: clearing it makes one side congruent to 1 modulo 2 and the other side even. Both exponents are nonnegative. Factor 12 = 2^2·3.

Equal exponents would require 2^x = 6, which is not a power of 2. If x > y, then 2^y(2^(x-y) + 1) = 12 and the second factor is odd, so y = 2 and 2^(x-2) = 2. Thus x = 3. The only integer solutions are (x, y) = (2, 3) and (3, 2). Both give x + y = 5 and x·y = 6. The real solution set is a curve; these two pairs are the integer points on it.

Equation

solve(2^x + 2^y = 12, x, y, domain=integers)

How the equation is solved

Solve Equation keeps the algebra steps, not a curve. A linear equation isolates the variable. A polynomial can have several roots. A result is kept exact when it is an integer, a fraction, or a simple radical, and an approximation is added only when that helps.

Some inputs are identities or contradictions. 0·x = 0 is true for every x. 0·x = 5 is true for none. A system followed by 'find' solves the equations first and then evaluates the requested expression. The editor below sends the text you leave in the field.

Reading the input

Try a change

Solve Equation opens the original input in the equation workspace and displays its symbolic results, conditions, and solution steps.

Edit and generate

Solve Equation opens the studio homepage and runs this field. Open in DGS Studio loads the same text and waits for you to generate it. The equation is sent once, as a query parameter.

Related examples