Getting integer solutions for equation $x^{2}-y^{4}=336$ I need to get integer solutions for the next equation: $$x^{2}-y^{4}=336$$ I know equations that look like $x^{2}-y^{2}=n$ have solutions $x$ and $y$ where $x=\frac{a+b}{2}$ and $y=\frac{a-b}{2}$, $a$ and $b$ being both odd or even. But I can not figure out how to solve the equation.
 A: From
$$x^2 - y^4 = 336 \iff (x - y^2)(x + y^2) = 336$$
we note that:


*

*$x - y^2$ and $x + y^2$ are both divisors of $336$;

*$x$ and $y^2$ must be either both even or both odd.

*$x > y^2$;


The divisor pairs of $336$ are
$$(1,\ 336),\ (2,\ 168),\ (3,\ 112),\ (4,\ 84),\ (6,\ 56),\ (7,\ 48),\ (8,\ 42),(12,\ 28),\ (14,\ 24),\ (16,\ 21)$$
and applying condition $(2)$ we reduce them down to
$$(2,\ 168),\ (4,\ 84),\ (6,\ 56),\ (8,\ 42),\ (12,\ 28),\ (14,\ 24).$$
Now, if you know the sum and the difference of two quantities you can go back to the original quantities. Applying this observation to the above pairs yields
$$(85,\ 83),\ (44,\ 40),\ (31,\ 25),\ (25,\ 17),\ (20,\ 8),\ (19,\ 5).$$
Those are $x$ and $y^2$ respectively. Since the second member of the pair must be a perfect square the only candidate left is
$$(31,\ 25),$$
that is, $x = 31$ and $y = 5$. You can check that this is the only solution.
Note: I included only the solutions with $x, y \in \mathbb N$. It is trivial to extend the result to $\mathbb Z$.

As an aid for myself I wrote this Haskell program. Maybe someone will find it interesting:
https://gist.github.com/rubik/47436a726143393e3d20
A: try substitution of 

z=y^2

then you will have x^2-z^2 = 336. As you will find x and z, you will find y as well
A: You were doing correct. The equation is also equal to $(x+y^2)(x-y^2)$. Now you know that $x,y^2$ are of same parity. Factorize 336 as $2^4*3*7$. Make cases like 336*1(no solution)...etc. Let me know if I need to elaborate.
