# Find $(a^2+b^2),$ where $(a+b)=\dfrac{a}{b}+\dfrac{b}{a}$ [duplicate]

The question is the same .Find $a^2+b^2$. I think we have to find $a$ and $b$ firstly. Given that $a$ and $b$ are integers.

## marked as duplicate by Bill Dubuque elementary-number-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 22 '17 at 15:47

• Please keep question self contained and not a continuation of the title (that does not mean don't keep the title descriptive). There is some formula error too. – Aryabhata Aug 4 '17 at 3:29
• Where did $c$ come from? – Igor Rivin Aug 4 '17 at 3:31
• What is $c$? Isn't it should be $a$? If it is so then $a^2+b^2=ab(a+b)$. – Bumblebee Aug 4 '17 at 3:31

I assume your formula is $a+b=\dfrac ab+\dfrac ba,$ then $a^2+b^2=ab(a+b)$ and since $a^2+b^2=(a+b)^2-2ab,$ we have $$x^2-2y=xy,$$ where $x=a+b$ and $y=ab.$ From here you can find $x$ in-terms of $y$ as $$x=\dfrac{y\pm\sqrt{y^2+8y}}{2}.$$ Then $$\color{Green}{a^2+b^2=\left(\dfrac{y\pm\sqrt{y^2+8y}}{2}\right)y},$$ where $y$ is a parameter.

Also, if you only interest on $a,b$ integer solutions, we need to find $y$ so that $y^2+8y$ is a perfect square.

Edit:
To do this, note that $z^2=y^2+8y=(y+4)^2-16$ implies $16=(y-z+4)(y+z+4).$ Now find the all possible values of $y-z+4$ and $y+z+4$ using factors of $16.$ Then you will have to solve few simultaneous equations to find corresponding $y.$

Later:

As @MANMAID pointed out $y=1$ is the only possible value and this gives us $$\color{Red}{a^2+b^2=2.}$$

• you must show there exist perfect squares of the form $y^2+8y$ other than $y=1$... – MAN-MADE Aug 4 '17 at 4:01
• Obviously $y=0$ is another one and it is not difficult to find all such $y$ values by considering the equation $y(y+8)=z^2.$ – Bumblebee Aug 4 '17 at 4:04
• if "it is not difficult to find", then give some example, sir. This is not an answer until you do so... OP strictly used $a,b$ are integers (btw $y=0$ is not a solution, check that!) – MAN-MADE Aug 4 '17 at 4:10
• $(y+4)^2=z^2+4^2$, then $(4,z,y+4)$ is a pythagorean triple. – MAN-MADE Aug 4 '17 at 4:15
• I guess you are missing the point that only pythagorean triple that contains $4$ is $(4,3,5)$, check that too... – MAN-MADE Aug 4 '17 at 4:20

Lemma(1): Let $a$ & $b$ to be integers such that $ab \mid a^2+b^2$. If $\gcd(a,b)=1$, then prove that $a=\pm b$.

Proof: We claim that $ab=\pm 1$.

• Proof of the claim: Suppose on contrary; that $1 < |ab|$. So there exist a prime number $p$, which divides $ab$; i.e. $p \mid ab$. Without loss of generality we can assume that $p \mid a$. So $p$ must divides $b^2=(a^2+b^2)-a^2$. [Because $p$ divides both of the $(a^2+b^2)$ & $a^2$.] So we can conclude that $p$ must divides $b$; which is an obvious contradiction with the assumption that $\gcd(a,b)=1$.

So we can conclude that $a=\pm 1$ & $b=\pm 1$; which implies that $a=\pm b$.

Lemma(2): Let $a$ & $b$ to be integers such that $ab \mid a^2+b^2$. Prove that $a=\pm b$.

Proof: Let $d:=\gcd(a,b)$, so there exist integers $a^{\prime}$ & $b^{\prime}$ such that:

$$a=da^{\prime} \ , \ \ \ \ \ \ \ b=db^{\prime} \ , \ \ \ \ \ \ \ \gcd(a^{\prime},b^{\prime})=1 .$$

The relation $ab \mid a^2+b^2$, implies that there is an integer $k$, such that:

$$k(ab) = a^2+b^2 \Longrightarrow k\big( (da^{\prime})(db^{\prime}) \big) = (da^{\prime})^2+(db^{\prime})^2 \Longrightarrow k\big( a^{\prime}b^{\prime} \big) = (a^{\prime})^2+(b^{\prime})^2 ,$$

so we obtain a pair $(a^{\prime},b^{\prime})$ such that:

$$a^{\prime}b^{\prime} \mid (a^{\prime})^2+(b^{\prime})^2 \ , \ \ \ \ \ \ \ \ \ \ \ \ \gcd(a^{\prime},b^{\prime})=1 .$$

So by Lemma(1) we have:

$$a=d(a^{\prime})=d(\pm b^{\prime})=\pm d(b^{\prime})=\pm b .$$

The relation

$$a+b=\frac{a}{b} + \frac{b}{a} \ \ , \ \ \ \ \ \ \ (*)$$

implies $ab(a+b)=a^2+b^2$, so we have: $ab \mid a^2+b^2$, so by the Lemma(2) we have one of the two folowing cases:

• $a= + b$ , in this case both of the fractions on the Right-hand-side of the relation $(*)$, both are equal to $+1$, so the R-H-S is equal to $+ 2$. On the other hand in this case the Left-hand-side of the relation $(*)$ is equal to $2a$, so must have: $2a=+2$, which yields the solution $a=b=+1$.

• $a= - b$ , in this case both of the fractions on the Right-hand-side of the relation $(*)$, both are equal to $-1$, so the R-H-S is equal to $- 2$. On the other hand in this case the Left-hand-side of the relation $(*)$ is equal to $0$, so must have: $0=-2$, which is impossible.

So the quantity $a^2+b^2$ will be equal to $2$.

The condition gives $$(a+b)ab=a^2+b^2$$ or $$(b-1)a^2+b^2a-b^2=0.$$

If $b=1$ we obtain $a=1$ and $a^2+b^2=2$.

If $b\neq1$ we need $b^4+4b^2(b-1)=m^2$, where $m\in\mathbb N$ or $$b^2+4b-4=n^2,$$ where $n\in\mathbb N$ or $$(b+2)^2=8+n^2$$ or $$(n-b-2)(n+b+2)=-8$$ and since $n>0$, we obtain two cases only:

1. $n-b-2=4$ and $n+b+2=-2$, which gives $n=1$, $b=-5$, $a=\frac{5}{2}$ or $a=\frac{5}{3},$ which is impossible;

2. $n-b-2=-2$ and $n+b+2=4$, which gives $n=1$, $b=1,$ which is impossible here.

Done!

Let $|a|= a'd$, $\>|b|= b'd$ with $d\geq1$ and ${\rm gcd}(a',b')=1$. Then $$a+b={a\over b}+{b\over a}=\pm\left({a'\over b'}+{b'\over a'}\right)$$ is integer only if both fractions on the right hand side are integers, and this is only the case if $a'=b'=1$. It follows that $|a|=|b|$ and $a+b=\pm2$, hence $a=b=\pm1$ and $a^2+b^2=2$.

$$a+b=\frac{a}{b} + \frac{b}{a}$$

therefore,$$a^2+b^2=ab(a+b)$$ or,$$a^2(1-b)+b^2(1-a)=0$$ from this relation we can say $1-b=1-a=0$

therefore,$$a=b=1$$

so finally, $$a^2+b^2=2$$

• $ax^2+by^2=0$ does not implies $a=b=0.$ – Bumblebee Aug 4 '17 at 3:36
• The Question specifies that $a,b$ are integers. Possibly you can use this assumption to fix the above gap in your solution. – hardmath Aug 4 '17 at 4:58