I am trying to figure out a way to factor $a^n+b^n$, but all I found is odd cases where $a^n+b^n=(a+b)(a^{n-1} -a^{n-2}b+...-ab^{n-2}+b^{n-1})$.
Is there any such way to factor it either by using complex numbers or with the use of calculus into one general form for all positive integers of n?
For reference, if you go to https://www.quora.com/What-is-the-formula-for-a-n-b-n, this was not the answer I was quite looking for.
Let's look at $X^n+1$ instead. Then $$X^n+1=\frac{X^{2n}-1}{X^n-1}.$$ Over the rationals, the irreducible factorisation of $X^n-1$ is $$X^n-1=\prod_{d\mid n}\Phi_d(X)$$ where $\Phi_d$ is the $d$-th cyclotomic polynomial. Therefore $$X^n+1=\frac{\prod_{d\mid n}\Phi_{2d}(X)}{\prod_{d\mid n}\Phi_d(X)} =\prod_{d\mid 2n,d\nmid n}\Phi_d(X).$$
Now homogenise: $$a^n+b^n=\prod_{d\mid 2n,d\nmid n}\Phi_d(a,b)$$ where $$\Phi_d(X,Y)=Y^{\deg \Phi_d}\Phi_d(X/Y).$$