<s>[INST] $\sqrt{x^2-16} - (x-4) = \sqrt{x^2-5x+4}$ How do I solve this equation I found in my textbook:

$\sqrt{x^2-16} - (x-4) = \sqrt{x^2-5x+4}$ 

This is what I tried:
$\sqrt{x^2-16} - (x-4) = \sqrt{x^2-5x+4}$
$\mapsto \sqrt{(x+4)(x-4)} - (x-4) = \sqrt{(x-1)(x-4)}$

Dividing both sides by $\sqrt{x-4}$

$\mapsto \sqrt{x+4} - \sqrt{x-4} = \sqrt{x-1} $

Squaring both Sides

$\mapsto x - 2 \sqrt{x^2 - 16}= -1$
$\mapsto \frac{x+1}{2} = \sqrt{x^2 - 16}$

Squaring both sides

$ \mapsto \frac{x^2 + 2x + 1}{4} = x^2 - 16$
$\mapsto 3x^2 -2x - 65 = 0$

Solving the quadratic equation

$$x = 5 OR \frac{-13}{3}$$
Checking in the initial equation we can see that $5$ is a valid root. But the second value that is given in the key to the book is $4$. How do I obtain $4$?
 [/INST] The domain gives $x\geq4$ or $x\leq-4$.


*

*$x\leq-4$.


We need to solve $$\sqrt{(4-x)(-4-x)}+\left(\sqrt{4-x}\right)^2=\sqrt{(4-x)(1-x)}$$ or
$$\sqrt{-4-x}+\sqrt{4-x}=\sqrt{1-x}$$ or
$$-4-x+4-x+2\sqrt{x^2-16}=1-x$$ or
$$2\sqrt{x^2-16}=x+1,$$ which has no real roots.


*$x\geq4.$


We have $$\sqrt{(x-4)(x+4)}=\left(\sqrt{x-4}\right)^2+\sqrt{(x-4)(x-1)},$$ which gives
$$x=4$$ or
$$\sqrt{x+4}=\sqrt{x-4}+\sqrt{x-1},$$ which is
$$x+4=x-4+x-1+2\sqrt{x^2-5x+4}$$ or
$$2\sqrt{x^2-5x+4}=9-x,$$ which gives $$4\leq x\leq9$$ and
$$4(x^2-5x+4)=(9-x)^2$$ or
$$3x^2-2x-65=0,$$ which gives $$x=5$$ and the answer:
$$\{4,5\}.$$
</s>