Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

How can I find the positive integer solutions to $x$ and $y$, given the integers $a$, $b$ and $c$ in the following ellipse equation in the form:

$\frac{x^2}{a^2} + \frac{y^2}{b^2}=c$

For example, when $a, b, c = 1,2,2$, one possible solution may be $x, y = 1,2$:

$\frac{1^2}{1^2} + \frac{2^2}{2^2}=2$

share|improve this question
The standard form I have seen requires $c=1$. I wasn't sure if this was a typo on your part or part of your question so I didn't edit it. –  nullUser Sep 18 '12 at 22:25
when c is 1, then the radii of the ellipse are a and b (are they still called radii?) but unless it is 0 (in which case it is a degenerate point), then the radii will be $a\sqrt{c}, b\sqrt{c}$ –  mathguy Sep 18 '12 at 22:31

1 Answer 1

up vote 0 down vote accepted

Let's rewrite the equation as $$b^2x^2+a^2y^2=a^2b^2c$$ First of all, if $c\le0$, then clearly there are no solutions in positive integers $x,y$. So, we assume $c\gt0$. Then you can simply test each value $x=1,2,\dots,r$, where $r\lt a\sqrt c\le r+1$, to see whether the corresponding $y$-value is an integer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.