# Number theory with binary quadratic

I found this questions from past year maths competition in my country, I've tried any possible way to find it, but it is just way too hard.

Given $$\frac {x^2-y^2+2y-1}{y^2-x^2+2x-1} = 2$$ find $x-y$

I'm not sure if given choices is right... (A)2 (B)3 (C)4 (D)5 (E)6

I've tried to move them $$x^2-y^2+2y-1 = 2y^2-2x^2+4x-2$$ $$x^2-y^2+2y-1 - 2y^2+2x^2-4x+2 = 0$$ $$3x^2-3y^2+2y-4x+1=0$$ $$(3x-1)(x-1)-(3y-1)(y+1)+1=0$$

I've stuck in here, not sure if I've found x and y, or not...

EDIT: I've move other questions to other posts, thanks for helping me identifying the questions category.

• lets try to keep it at one problem per post please. – Jorge Fernández Hidalgo Jul 25 '15 at 6:57
• @dREaM i can't identify most of these question's category – wuiyang Jul 25 '15 at 7:01
• Limiting to one question per question would help with your tagging woes, too :-) – Jyrki Lahtonen Jul 25 '15 at 7:04
• @wuiyang All questions should have the tag contest-math. Furthermore 1,2,3,5,6,7 should have the tag algebra-precalculus. 4,8,9 should have the tag elemetary-number-theory. 7 should have the tag polynomials. – wythagoras Jul 25 '15 at 7:06
• @wythagoras thanks, I will edit the questions now – wuiyang Jul 25 '15 at 7:10

Recognize the squares of binomials in both the numerator and denominator to rewrite the equation as \begin{align}\frac{x^2-(y-1)^2}{y^2-(x-1)^2} &= 2, \end{align} and thus, factoring, \require\cancel \begin{align}\frac{(x-y+1)\cancel{(x+y-1)}}{(y-x+1)\cancel{(y+x-1)}}&=2. \end{align} Finally, let $t=x-y$ and multiply both sides by $1-t$ to have \begin{align} t+1&=2(1-t) \\ 3t&=1 \\ t&=\frac{1}{3}. \end{align}
Put $t=x-y$ then $x=y+t.$ Substitute it into the expression you get $${\frac {t+1}{1-t}}=2.$$ By solving it you get $t=\dfrac{1}{3}.$
\begin{align} 2&= \frac {x^2-y^2+2y-1}{y^2-x^2+2x-1} \\ &=\frac {x^2-(y^2-2y+1)}{y^2-(x^2-2x+1)} \\ &= \frac {x^2-(y-1)^2}{y^2-(x-1)^2} \\ &= \frac {(x-y+1)(x+y-1)}{(y+x-1)(y-x+1)}\end{align} $$\implies {x-y+1}=2y-2x+2\\ 3(x-y)=1$$
Thus, $x-y=\dfrac13$