Reflexion of an element on $P_1(\Bbb R)$ Let $p, q \in P_3(\Bbb R)$.  Define the inner product by
$$\langle p(x), q(x)\rangle = \int_0^1 p(x) q(x) \, dx $$
What is the reflection of $q(x) = x ^ 2$ on the subspace $P_1(\Bbb R)$?
My result is $R(q)(x) = \frac{2}{3} + \frac{3x}{2} - x^2 $
But the answer in the book is $ R(q)(x) = -\frac{1}{3} + 2x - x^2$
I don't what is the right procedure to this problem.
 A: You have to start with an orthogonal base for $P_1(\Bbb R)$ in order to calculate the reflection.


*

*We take $1$ as the first element of our orthogonal base for $P_1(\Bbb R)$.


*

*$\lVert1\rVert^2 = \langle1,1\rangle = 1$ is obvious.


*We apply the Gram-Schmidt process on $x$ and $x^2$ to obtain the second and third element in this basis.  At this stage, we'll have the projection of $q(x)=x^2$ on $P_1(\Bbb R)$, denoted by $\pi(q(x))=\pi(x^2)$.


*

*$x-\dfrac{\langle x,1 \rangle}{\lVert1\rVert^2}\cdot 1 = x - \dfrac{\int_0^1 x\,\mathrm{d}x}{1} = x - \dfrac12$, which is the second element in our orthogonal basis.

*Find $\pi(q(x))$.
\begin{align}
& \pi(q(x)=\pi(x^2) \\
=& \frac{\langle x^2, 1\rangle}{\langle 1, 1\rangle} \cdot 1 + \frac{\langle x^2, x - \frac12 \rangle}{\langle x - \frac12, x - \frac12 \rangle} \cdot \left(x - \frac12\right)  \\
=& \frac{\int_0^1 x^2\,\mathrm{d}x}{1} \cdot 1 + \frac{\int_0^1\left(x^3-\frac12 x^2\right)\,\mathrm{d}x}{\int_0^1 \left(x - \frac12\right)^2\,\mathrm{d}x} \cdot \left(x - \frac12\right)  \\
=& \frac{\frac13}{1}\cdot 1 + \frac{\left.\frac14 x^4 - \frac16 x^3 \right\rvert_0^1}{\left.\frac13\left(x-\frac12\right)^3\right\rvert_0^1}\cdot \left(x - \frac12\right)  \\
=& \frac13 + \frac{\frac14-\frac16}{\frac23 \left(\frac12\right)^3} \cdot \left(x - \frac12\right) \\
=& x - \frac16
\end{align}


*We calculate
\begin{align}
R(q)(x) =& 2\pi(q(x))-x^2 \\
=& 2\pi(x^2)-x^2 \\
=& 2 \left(x - \frac16\right)-x^2 \\
=& -x^2 + 2x -\frac13.
\end{align}

