How can I determine the Steenrod Square $Sq^2$ for complex projective space?

I am trying to learn about Steenrod Squares for algebraic varieties so that I can compute examples of complex topological K-theory using the Atiyah-Hirzebruch Spectral Sequence (AHSS).

One of the key points about this sequence is that the third differential $d_3$ is the steenrod squaring operation $Sq^3$ on integral cohomology. This is defined as the composition $$\beta \circ Sq^2 \circ r$$ where $r$ is the reduction mod $2$ cohomology and $\beta$ is the connecting morphism associated to $$0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2 \to 0$$ Since these operations play well with functoriality, I will only need to determine the Steenrod operations in $\mathbb{CP}^n$ in specific cases: If I have a smooth projective 3-hypersurface $X$ then the only non-trivial differential factors through $H^2(\mathbb{CP}^4)$. How can I determine this cohomology operation?

The cohomology ring $H^*(\mathbb{C}P^n;R)\cong R[x_2]/(x_2^{n+1})$ can be calculated for any coeffient ring $R$ using the Gysin sequence of the fibration $S^1\hookrightarrow S^{2n+1}\rightarrow \mathbb{C}P^{n}$. In particular it is a truncated polynomial ring on a single degree 2 class $x_2\in H^2(\mathbb{C}P^n;R)$. Now use the fact that for any non-negative integer $r$ and any space $X$, $Sq^r$ acts on $H^r(X;\mathbb{Z}_2)$ as the squaring operation $x\mapsto x^2$. That is

$Sq^rx=x^2,\quad x\in H^r(X;\mathbb{Z}_2)$.

Now on the complex projective plane $\mathbb{C}P^1\cong S^2$ we obviously have

$Sq^2x_2=0$

since it is homeomorphic to $S^2$. For $n\geq 2$ we have that

$Sq^2x_2=x^2$

generates $H^4(\mathbb{C}P^n;\mathbb{Z}_2)\cong \mathbb{Z}_2$. This calculates the action of $Sq^2$ on $x_2$. To proceed from here we use the fact that the total Steenrod square $Sq=\sum_{r\geq 0}Sq^r=1+Sq^1+Sq^2+\dots$ is an endomorphism of the graded ring $H^*(X;\mathbb{Z}_2)=\oplus_{r\geq}H^r(X;\mathbb{Z}_2)$, together with the facts that $Sq^0x=x$, and $Sq^rx=0$ if $|x|<r$ and the observation that $H^(\mathbb{C}P^n;\mathbb{Z}_2)$ vanishes in odd degrees to get, on the one hand

$Sq(x^k)=(Sq\,x)^k=(x+x^2)^k=\sum_{i}\binom{k}{i}(x^2)^{i}x^{k-i}=\sum_i\binom{k}{i}x^{k+i}$,

recalling that the binomial coefficients are calculated mod 2, and on the other

$Sq(x^k)=x^k+Sq^2x^k+\dots Sq^rx^k+\dots=\sum_iSq^{2i}x^k$.

Now match up the degree of the elements in each expression to get

$Sq^{2r}x^k=\binom{k}{r}x^{k+r}$.

In particular on $\mathbb{C}P^n$ we have

$Sq^2x^k=\binom{k}{1}x^{k+1}=k\cdot x^{k+1}$

as long as $k<n$ and $Sq^2x^n=0$ for degree reasons.

If you only care about the action of $\operatorname{Sq}^2$ on $H^*(\mathbb{C}P^n; \mathbb{Z}/2)$, you can just recall that $\operatorname{Sq}^2$ acts by squaring on degree 2 elements in cohomology, and that $H^*(\mathbb{C}P^n; \mathbb{Z}/2)$ is generated as an algebra in degree 2. So additivity and the Cartan formula will tell us everything about the action of $\operatorname{Sq}^2$ on $H^*(\mathbb{C}P^n; \mathbb{Z}/2)$.

In general, you may want to know the action of the other Steenrod squares. As mentioned above, the cohomology of complex projective space $\mathbb{C}P^n$ is a truncated polynomial algebra on the first Chern class, and the action of Steenrod operations on characteristic classes are given by Wu's formula. See remark 6.4 here for a reference and proof.