Combine two known solutions (x₁, y₁) and (x₂, y₂) of x² − Dy² = 1 using the same positive, nonsquare integer D. Enter integer coordinates and check that both displayed input norms equal 1 before interpreting the resulting pair as a Pell solution. The defaults combine (3, 2) and (17, 12) for D = 2.

\[X=x_1x_2+Dy_1y_2,\qquad Y=x_1y_2+x_2y_1\]
\[X^2-DY^2=(x_1^2-Dy_1^2)(x_2^2-Dy_2^2)\]

The pairs (3, 2) and (17, 12) satisfy 3² − 2 × 2² = 1 and 17² − 2 × 12² = 1.

Composition gives X = 3 × 17 + 2 × 2 × 12 = 99 and Y = 3 × 12 + 17 × 2 = 70. Checking the result gives 99² − 2 × 70² = 9801 − 9800 = 1.

Use a nonsquare integer D from 2 to 1000 and integer coordinates from −1000 to 1000. Negative coordinates and the trivial solution (1, 0) are allowed. Both pairs must use the single D entered above.

The calculator performs composition arithmetic and displays each input norm. It does not automatically test whether D is nonsquare or suppress results for invalid Pell inputs. Confirm the integer requirements and both norms yourself; a displayed coordinate pair alone does not establish that the inputs are Pell solutions. Fractional entries are outside this tool’s intended use, and rounded displays must not be used to validate them.

The bounds keep all integer operations in this graph within exact binary floating-point integer range. Large Pell solutions can exceed these input limits and require an arbitrary-precision implementation. An unavailable result is not zero.

Can I combine a solution with itself?

Yes. Enter the same pair twice. The formulas become X = x² + Dy² and Y = 2xy. For D = 2, composing (3, 2) with itself gives (17, 12).

Does the order of the two solutions matter?

No. Swapping the pairs leaves both composition formulas unchanged.

What if an input norm is not 1?

That pair is not a solution of the positive Pell equation x² − Dy² = 1. The arithmetic still follows the norm identity: the composed norm equals the product of the two input norms. In particular, two integer pairs with norm −1 compose to a pair with norm 1.

Does this find the smallest solution for D?

No. This calculator combines supplied pairs. It does not search for a fundamental solution or enumerate all solutions.

Cute yellow star mascot illustrating Pell Equation Solution Composition Calculator.
· AI-generated illustration for Starlight Tools