[proofplan]
We identify the smooth real tangent bundle of $\mathbb{CP}^n$ with the underlying real bundle of the holomorphic tangent bundle $T_{\mathrm{hol}}\mathbb{CP}^n$. The Euler sequence computes the total Chern class of $T_{\mathrm{hol}}\mathbb{CP}^n$ as $(1+h)^{n+1}$, so its first two Chern classes are explicit binomial coefficients. Finally, the standard relation $p_1(V_{\mathbb R})=c_1(V)^2-2c_2(V)$ converts those Chern classes into the first Pontryagin class.
[/proofplan]
[step:Identify the real tangent bundle with the underlying real holomorphic tangent bundle]
Let $J:T_{\mathbb R}\mathbb{CP}^n\to T_{\mathbb R}\mathbb{CP}^n$ denote the almost complex structure induced by the complex manifold structure on $\mathbb{CP}^n$. Let $T_{\mathrm{hol}}\mathbb{CP}^n\to \mathbb{CP}^n$ denote the holomorphic tangent bundle, viewed as a smooth complex vector bundle of rank $n$. The map
\begin{align*}
\Phi:T_{\mathbb R}\mathbb{CP}^n\to (T_{\mathrm{hol}}\mathbb{CP}^n)_{\mathbb R}
\end{align*}
defined fiberwise by
\begin{align*}
\Phi_p(v):=\frac{1}{2}(v-iJ_pv)
\end{align*}
is an isomorphism of smooth real vector bundles. Therefore
\begin{align*}
p_1(T_{\mathbb R}\mathbb{CP}^n)=p_1((T_{\mathrm{hol}}\mathbb{CP}^n)_{\mathbb R}).
\end{align*}
[/step]
[step:Compute the first two Chern classes of the holomorphic tangent bundle]
For a complex vector bundle $E\to M$, write $c(E):=1+c_1(E)+c_2(E)+\cdots$ for its total Chern class. We use the Euler sequence on complex [projective space](/page/Projective%20Space), where $\mathcal O$ denotes the holomorphic line bundle with a nowhere vanishing global section:
\begin{align*}
0\to \mathcal O\to \mathcal O(1)^{\oplus(n+1)}\to T_{\mathrm{hol}}\mathbb{CP}^n\to 0.
\end{align*}
By the [Whitney product formula for Chern classes](/theorems/7052) applied to this short exact sequence, and since $c(\mathcal O)=1$, one obtains
\begin{align*}
c(T_{\mathrm{hol}}\mathbb{CP}^n)=c(\mathcal O(1)^{\oplus(n+1)}).
\end{align*}
Again by the Whitney product formula for the [direct sum](/page/Direct%20Sum) $\mathcal O(1)^{\oplus(n+1)}$,
\begin{align*}
c(\mathcal O(1)^{\oplus(n+1)})=(1+h)^{n+1}.
\end{align*}
Thus, in the truncated [cohomology ring](/theorems/2271) of $\mathbb{CP}^n$,
\begin{align*}
c(T_{\mathrm{hol}}\mathbb{CP}^n)=(1+h)^{n+1}.
\end{align*}
Extracting the degree $2$ and degree $4$ terms gives
\begin{align*}
c_1(T_{\mathrm{hol}}\mathbb{CP}^n)=(n+1)h
\end{align*}
and
\begin{align*}
c_2(T_{\mathrm{hol}}\mathbb{CP}^n)=\binom{n+1}{2}h^2.
\end{align*}
[guided]
The point of the Euler sequence is that it replaces the tangent bundle by line bundles whose Chern classes are already known. For a complex vector bundle $E\to M$, write $c(E):=1+c_1(E)+c_2(E)+\cdots$ for its total Chern class. The sequence
\begin{align*}
0\to \mathcal O\to \mathcal O(1)^{\oplus(n+1)}\to T_{\mathrm{hol}}\mathbb{CP}^n\to 0
\end{align*}
is a short exact sequence of holomorphic vector bundles on $\mathbb{CP}^n$, where $\mathcal O$ denotes the holomorphic line bundle with a nowhere vanishing global section. The Whitney product formula for Chern classes applies to such a sequence and gives
\begin{align*}
c(\mathcal O(1)^{\oplus(n+1)})=c(\mathcal O)c(T_{\mathrm{hol}}\mathbb{CP}^n).
\end{align*}
Since $c(\mathcal O)=1$, this becomes
\begin{align*}
c(T_{\mathrm{hol}}\mathbb{CP}^n)=c(\mathcal O(1)^{\oplus(n+1)}).
\end{align*}
Now apply the Whitney product formula to the direct sum of $n+1$ copies of $\mathcal O(1)$. Since $h=c_1(\mathcal O(1))$, the total Chern class of each copy is $1+h$. Therefore
\begin{align*}
c(\mathcal O(1)^{\oplus(n+1)})=(1+h)^{n+1}.
\end{align*}
Consequently
\begin{align*}
c(T_{\mathrm{hol}}\mathbb{CP}^n)=(1+h)^{n+1}.
\end{align*}
To read off the first two Chern classes, expand the binomial expression in cohomological degree. The degree $2$ term is
\begin{align*}
(n+1)h,
\end{align*}
so
\begin{align*}
c_1(T_{\mathrm{hol}}\mathbb{CP}^n)=(n+1)h.
\end{align*}
The degree $4$ term is
\begin{align*}
\binom{n+1}{2}h^2,
\end{align*}
so
\begin{align*}
c_2(T_{\mathrm{hol}}\mathbb{CP}^n)=\binom{n+1}{2}h^2.
\end{align*}
If $n<2$, then $H^4_{\mathrm{dR}}(\mathbb{CP}^n;\mathbb R)=0$, and this same computation is interpreted in the truncated cohomology ring.
[/guided]
[/step]
[step:Convert the Chern class computation into the Pontryagin class]
Let $V:=T_{\mathrm{hol}}\mathbb{CP}^n$, and let $\overline V\to \mathbb{CP}^n$ denote the conjugate complex vector bundle, whose underlying real bundle is the same as $V_{\mathbb R}$ and whose scalar multiplication is conjugated fiberwise. For any smooth complex vector bundle $V\to M$, the first Pontryagin class of its underlying real bundle satisfies
\begin{align*}
p_1(V_{\mathbb R})=c_1(V)^2-2c_2(V).
\end{align*}
This follows from [[Pontryagin Classes from Chern Classes of the Complexification](/theorems/9780)][citetheorem:9780] and [[Chern Classes of Conjugate Complex Vector Bundles](/theorems/9778)][citetheorem:9778], since
\begin{align*}
(V_{\mathbb R})_{\mathbb C}\cong V\oplus \overline V
\end{align*}
and hence
\begin{align*}
p_1(V_{\mathbb R})=-c_2((V_{\mathbb R})_{\mathbb C})=c_1(V)^2-2c_2(V).
\end{align*}
Substituting the Chern classes computed above gives
\begin{align*}
p_1(T_{\mathbb R}\mathbb{CP}^n)=\bigl((n+1)h\bigr)^2-2\binom{n+1}{2}h^2.
\end{align*}
Since
\begin{align*}
2\binom{n+1}{2}=n(n+1),
\end{align*}
we get
\begin{align*}
p_1(T_{\mathbb R}\mathbb{CP}^n)=\bigl((n+1)^2-n(n+1)\bigr)h^2.
\end{align*}
The coefficient simplifies to $n+1$, so
\begin{align*}
p_1(T_{\mathbb R}\mathbb{CP}^n)=(n+1)h^2.
\end{align*}
This is the desired identity in $H^4_{\mathrm{dR}}(\mathbb{CP}^n;\mathbb R)$.
[/step]