## ganeshie8 one year ago find all pairs of positive rational numbers $$(a,b)$$ such that $$\frac{a}{b}+\frac{b}{a}$$ is an integer

1. freckles

well an obvious pair would be (1,1)

2. Empty

a and b are rational numbers to begin with and not integers?

3. ganeshie8

yes, $$a$$ and $$b$$ are rational it seems $$(1,1)$$ is the only solution...

4. Empty

5. Loser66

I think set of all a, b such that a =b

6. anonymous

All cases where a=b.

7. Empty

;)

8. freckles

$a=\frac{m}{n} \text{ and } b=\frac{r}{s} \\ \frac{a}{b}+\frac{b}{a}=\frac{(ms)^2+(rn)^2}{mrns}$ I was kinda thinking about doing something with Pythagorean triplets

9. ganeshie8

Haha right, $$\{(t,t)| t\in \mathbb{Q^{+}}\}$$ no other pairs ?

10. Empty

Hmmm it would be really nice if we weren't restricted to positive values for a and b.

11. ganeshie8

this is part of a problem where a, b happen to be positive rationals letting a,b negative simplifies the work is it ?

12. Empty

I don't know it just gives more freedom to play around haha. I was thinking of the geometric series and trying to figure out how to make that work. Specifically taking @freckles and putting in something like $\frac{m^2s^2 + r^2n^2}{mrns} = \frac{x^{2y}-1}{x-1}$ And trying to find solutions here between stuff idk

13. ganeshie8

Here is the complete problem : https://i.gyazo.com/0c248335ae5de46d24e0ac606c15be22.png

14. freckles

how did you reduce it down to this one

15. ganeshie8
16. ganeshie8

btw in the actual problem $$a=b$$ is not a solution because the left hand side vanishes then..

17. freckles

ah ok

18. ganeshie8

actually i wanted to show that the only integer value of a/b + b/a is 2 when a,b are positive are rationals

19. freckles

oh i see the problem came from @Astrophysics 's post it was the one posted by @mukushla

20. ganeshie8

yes.. that one..

21. freckles

$\frac{a}{b}+\frac{b}{a}=2 \\ a^2+b^2=2ab \\ (a-b)^2=0 \\ a=b$

22. freckles

but a can't be b because that one side vanishes

23. freckles

so that would be mean that one thingy can't be 2

24. ganeshie8

right, then we conclude that there are no solutions

25. ganeshie8

it all boils down to showing that $$\frac{a}{b}+\frac{b}{a}$$ cannot be an integer when $$a\ne b$$

26. ganeshie8

$a=\frac{m}{n} \text{ and } b=\frac{r}{s} \\ \frac{a}{b}+\frac{b}{a}=\frac{(ms)^2+(rn)^2}{mrns} = \dfrac{x^2+y^2}{xy}$ say, $$\dfrac{x^2+y^2}{xy}=t$$ $$\implies \color{red}{x}^2-ty\color{red}{x}+y^2=0$$ $$\implies x= \dfrac{ty\pm y\sqrt{t^2-4}}{2}$$ it follows that $$t^2-4$$ must be a perfect square

27. Empty

Wait how can $$t^2-4$$ be a perfect square when it's $$(t-2)(t+2)$$?

28. ganeshie8

exactly, $$t=2$$ is the only positive integer that makes $$t^2-4$$ a perfect square (need to prove this tough)

29. Empty

$$n^2 \ne x*(x+4)$$ sorta seems intuitive for some reason to me because the values are too large and basically consecutive but idk how to reason this out.

30. dan815

|dw:1439177787318:dw|

31. dan815

theres no integer way of divining that 4 to form a perfect square

32. anonymous

well, if $$a,b$$ are rational then $$a/b,b/a$$ are rational so let's focus on rationals of the form $$r,1/r$$: $$r+\frac1r=\frac{r^2+1}r$$ so lets write $$r=p/q$$ in reduced form giving $$\frac{p^2/q^2+1}{p/q}=\frac{p^2+q^2}{pq}$$ so we want integers $$p,q$$ such that $$pq$$ divides $$p^2+q^2$$. consider $$p^2+q^2=(p+q)^2-2pq=(p-q)^2+2pq$$ so it follows we need $$(p+q)^2,(p-q)^2$$ divisible by $$ab$$. it follows then that $$(p+q)(p-q)=p^2-q^2$$ must be divisible by $$ab$$, and thus that $$p^2,q^2$$ individually are divisible by $$a,b$$

33. anonymous

oops, where I write divisible by $$ab$$ I mean by $$pq$$, so we know that $$p,q$$ are divisible by $$q,p$$ respectively

34. anonymous

but if $$q|p$$ and $$p|q$$ then it follows that $$p=q$$, so it must be that $$r=1/r=1$$

35. anonymous

so the rational $$a,b$$ must be such that $$a=b$$ so that $$r=a/b=1=b/a=1/r$$, meaning the solutions are precisely: $$\{(x,x):x\in\mathbb Q^+\}$$

36. ganeshie8

it follows then that $$(p+q)(p-q)=p^2-q^2$$ must be divisible by $$pq$$ i didn't get that part... $$(p+q)^2, (p-q)^2$$ are divisible by $$pq$$ implies $$(p+q)^2(p-q)^2$$ is divisible by $$pq$$ right ?

37. anonymous

well clearly since $$(p+q)^2,(p-q)^2$$ are divisible by $$pq$$, then $$(p+q)^2(p-q)^2$$ is divisible by $$p^2q^2$$, so $$(p+q)(p-q)=p^2-q^2$$ is divisible by $$pq$$. and then since $$pq$$ divides $$p^2+q^2,p^2-q^2$$ we can take integer combinations: $$p^2+q^2+p^2-q^2=2p^2\\p^2+q^2-(p^2-q^2)=2q^2$$ so we have that $$pq$$ divides $$2p^2,2q^2$$

38. anonymous

and we can conclude that $$p|2q$$ and $$q|2p$$

39. ganeshie8

well clearly since $$(p+q)^2,(p-q)^2$$ are divisible by $$pq$$, then $$(p+q)^2(p-q)^2$$ is divisible by $$p^\color{red}{2}q^\color{red}{2}$$ sorry to persist, but that square is troubling me.. that is true only if $$p+q$$ and $$p-q$$ have no factors in common right ?

40. anonymous

no, because if $$pq$$ divides each individually then clearly each contributes at least one factor of $$pq$$ so their product must have $$(pq)^2=p^2q^2$$

41. ganeshie8

omg! yes that works beautifully!!

42. ganeshie8

i see you're working it using pure divisibility arguments i think we can finish off the proof early by considering the quadratic : $r+\frac{1}{r}=t \implies r = \dfrac{t\pm\sqrt{t^2-4}}{2}$ that right hand side is irrational unless $$t=\pm 2$$ $$\implies r=\pm 1\implies a=\pm b$$

43. Empty

$$n^2 \ne x*(x+4)$$ sorta seems intuitive for some reason to me because the values are too large and basically consecutive but idk how to reason this out.

44. ganeshie8

$$n^2-4 = k^2 \implies (n+k)(n-k)=4$$ right hand side has finite number of factors...

45. anonymous

Well, it's essentially the same thing that @oldrin.bataku did, but it's a different way of saying it. Let $$\frac{a}{b} = \frac{p}{q}$$ in its reduced form , that is $$(p,q) = 1$$ Suppose now $$\frac{p}{q} + \frac{q}{p} = n$$ where $$n$$ is an integer. So, $$p^2 + q^2= npq$$. Now, $$q$$ divides $$npq$$ and $$q^2$$ . So $$q$$ must divide $$p^2$$, but $$(p,q) = 1$$ , so, $$q$$ must be $$1$$. Similarly, we can argue for $$p$$ to show $$p$$ must be $$1$$. so, $$a/b = p/q = 1$$ so whenever $$a/b+b/a$$ is an integer, $$a$$ and $$b$$ must be equal.

46. ganeshie8

Looks really neat! thnks! :)