Using the inner product of the previous problem, let \(\mathcal{B}=\left\{1, x, 3 x^{2}-1\right\}\) be an orthogonal basis for the space \(\mathcal{P}_{2}\) of quadratic polynomials and let \(\mathcal{S}=\operatorname{span}\left(x, x^{2}\right) \subset\) \(\mathcal{P}_{2}\). Using the basis \(\mathcal{B}\), find the linear map \(P: \mathcal{P}_{2} \rightarrow \mathcal{P}_{2}\) that is the orthogonal projection from \(\mathcal{P}_{2}\) onto \(\mathcal{S}\).