Let z be a complex number such that \(z^2=1\). Compute \(z+\frac{1}{z}+z^2+\frac{1}{z^2}\)
For the last 2 terms, you can just replace z^2 by 1 and calculate its value, so that is done.
For the first 2 terms, you want to rewrite it like this: \(z + \dfrac1z = \dfrac{z^2}z + \dfrac1z = \dfrac{z^2 + 1}z\)
Rewriting and substituting z^2 = 1 gives \(\dfrac{1 + 1}z + 1 + \dfrac11 = 2 + \dfrac2z\). This indicates the answer still depends on z.
Note that there are exactly 2 complex numbers satisfying z^2 = 1. (Hint: Move the 1 to the left-hand side and try to factorize.)
Depending on which one you consider, the required value will be different.
The answer Guest gave is not entirely correct due to this reason.