Factorise $f(a, b, c)=a^3+b^3+c^3$, if $a^2+b^2=c^2$. A while ago, in one of my country's respected mathematical journals, this problem came up:

If $a^2+b^2=c^2,$ factorise the following expression over the integers: $f(a, b, c)= a^3+b^3+c^3.$

I was baffled as I could not find a way around the problem. It reminded of a certain identity of Euler's but this was different and something seemed pretty off about the question itself. Anyway, $f$ is symmetric and invariant under all permutations of $a, b, c$ and homogeneous of $\deg 3$, meaning that $f(ta, tb, tc)=t^3f(a, b, c) \forall t \in \mathbb{Z}$, so the odd part was that $a^2+b^2=c^2$ is not symmetric for all those permutations aforementioned. Why would a distinction between $a, b, c$ be made in the requirement in the first place? Furthermore, the authors never responded with any answer whatsoever. I would very much appreciate if you could help untangle this problem and either solve it or prove definitively that it is impossible (which I think is much more likely). I believe I have tried every single possible way to factorise it but I have not been able to create any common factors between all three.
 A: Since $a^2 + b^2 = c^2$, then $(a, b, c)$ is a Pythagorean triple.
Without loss of generality, we may assume that
$$a = m^2 - n^2, b = 2mn, c = m^2 + n^2.$$
(I forgot if there is an extra condition on $m$ and $n$.)
WolframAlpha then gives the factorization
$$(m^2 - n^2)^3 + (2mn)^3 + (m^2 + n^2)^3 = 2m^2 (m + n)^2  (m^2 - 2mn + 3n^2).$$
This may be finally rewritten in terms of $a$, $b$, and $c$ as
$$a^3 + b^3 + c^3 = (a + c)(b + c)(2c - b - a).$$
A: Observe that
$$ 0 = (a^2 + b^2 - c^2 ) ( a+b+c) = a^3+b^3+c^3 - (a+c)(b+c)(2c-a-b).$$
Hence, we have $ a^3 + b^3 + c^3 = (a+c)(b+c)(2c-a-b)$.

Notes

*

*Assuming there's a nice solution (esp if it's an "olympiad problem"), then there are limited things we can try.

*We need to use the condition that $ a^2 + b^2 - c^2 = 0 $, which we likely have to multiply by a linear factor. $(a + b \pm c) $ makes the most sense.

*I first chose $ a + b - c $ because it gives us $ a^3+b^3+ c^3$, but then I couldn't factorize the rest of the terms (without further using $c^2=a^2+b^2$).

*I then went with $a+b+c$, which led to the above.

*If those didn't work, I would have tried $ a \pm b + c $ (but that's somewhat unlikely since $a, b$ should be symmetric).

*The other thing I tried was $ a^3+b^3 + c^3 - 3abc = (a+b+c)(a^2+b^2 + c^2 - ab - bc - ca)$ but that didn't seem to help. Note the $(a+b+c)$ term here, so there might be a way to force through the algebraic manipulation.

