<s>[INST] Is it 'not mathematical' to compare the L.H.S. and R.H.S in such type of equations? $$x+\frac{1}{x}=25 + \frac{1}{25}$$
The solution is very simple. But the problem is whether my solution is correct or not. I did it by simply comparing the LHS and the RHS. Thus, I got $x=25$ or $\frac{1}{25}$. But my book does it in this way
$x-25=\frac{1}{25}-\frac{1}{x}=\frac{x-25}{25x}$.  So, $x=25$ or $1=\frac {1}{25x}\implies x=\frac{1}{25}$.
I asked my teacher whether my method was correct or not. She told me that the method in the book is correct and that my method of comparing will not be accepted during the exam as it is 'not mathematical' and is 'some sort of hit and trial'. 
Now, I am not worried about whether I'll be awarded marks for my method or not. But is it 'not mathematical' to compare the L.H.S. and R.H.S in such type of equations?
 [/INST] The "longer" method is:
\begin{align}
x + \frac{1}{x} &= 25 + \frac{1}{25} \\
x^{2} + 1 &= \left(25 + \frac{1}{25} \right) x \\
x^{2} - \left(25 + \frac{1}{25} \right) x + 1 &= 0 \\
x &= \frac{1}{2} \, \left(25 + \frac{1}{25} \right) \pm \frac{1}{2} \, \sqrt{\left(25 + \frac{1}{25} \right)^2 - 4} \\
&= \frac{1}{2} \, \left(25 + \frac{1}{25} \right) \pm \frac{1}{2} \, \sqrt{\left(25 - \frac{1}{25} \right)^2} \\
&= \frac{1}{2} \, \left(25 + \frac{1}{25} \right) \pm \frac{1}{2} \, \left(25 - \frac{1}{25} \right) \\
x &= 25  \hspace{5mm} \mbox{or} \hspace{5mm} \frac{1}{25}.
\end{align}
</s>