<s>[INST] If $x^3+y^3=72$ and $xy=8$ then find the value of $x-y$. I recently came across a question,

If $x^3+y^3=72$ and $xy=8$ then find the value of $(x-y)$.

By trial and error I found that $x=4$ and $y=2$ satisfies both the conditions. But in general how can I solve it analytically? I tried using $a^3+b^3=(a+b)(a^2+b^2-ab)$ and also $a^3+b^3=(a+b)^3-3ab(a+b)$. But both ways aren't working.
Please explain how do I solve these types of questions analytically. 
 [/INST] Given  $$x^3+y^3=72$$
$$xy=8$$
Notice, 
$$(x+y)^3=x^3+y^3+3xy(x+y)$$ $$(x+y)^3=72+3(8)(x+y)$$
$$(x+y)^3-24(x+y)-72=0$$
Above is the cubic equation in terms of $(x+y)$ which has one real root $6$ Hence, we get $$x+y=6$$
Now, $$(x-y)^2=(x+y)^2-4xy$$
$$(x-y)=\pm\sqrt{(x+y)^2-4xy}$$
$$x-y=\pm\sqrt{(6)^2-4\times8 }$$
$$=\pm\sqrt{4}=\pm 2$$
Hence, we have 
$$\bbox[5px, border:2px solid #C0A000]{\color{red}{x-y=\pm 2}}$$
</s>