# How to find integer solutions for an ellipse equation?

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$

-
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

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.