Gram-Schmidt method to get a basis for $P_3$

gram-schmidtlinear algebraself-learning

If $P_3$ is a vector space of third-degree polynomials.
It is known the basis for $P_3$ is ${( 1,x,x^2 , x^3})$

and $\langle p, q\rangle = \int_{0}^{1} p(x)q(x)\, dx.$ is a valid product on $P_3$

I am trying to use the Gram-Schmidt method to get a basis for $P_3$ which is orthonormal with respect to the
above inner product.

Even though I found partial solutions or similar problems the explanations are limited.

PS. I read the rules before posting my first question. Even though I found similar problems I didn't understand entirely the method and calculations.

Additional Sources  
  1. the below exercise which has a partial solution, but I am not sure how to calculate the remaining values.
    enter image description here
  1. this question which is similar but in $P_2$ Finding an orthonormal basis for the space $P_2$ with respect to a given inner product

I hope I did not violate any rule. It was my last hope to ask here since due to current conditions I can't ask my Teacher face to face.

Best Answer

Graham Schmidt.

Pick a vector, to make it a candidate for your first basis vector.

$w_0 = 1$

Normalize it. Since $\|w_0\| = 1$ we that step is already done.

$e_0 = w_0 = 1$

Your second basis vector.

$w_1 = x$

Subtract the projection of $e_1$ onto $x.$

$e_1^* = x - \langle e_1,x\rangle e_1$

$e_1^* = x - \int_0^1 x \ dx = x-\frac 12$

Normalize it...

$e_1 = \frac {e_1^*}{\|e_1^*\|}$

$\|e_1^*\|^2 = \langle e_1^*,e_1^*\rangle = \int_0^1 (x-\frac 12)^2 \ dx\\ \int_0^1 x^2 -x + \frac 14\ dx = \frac 13 - \frac 12 + \frac 14 = \frac 1{12}\\ e_1 = \sqrt {12} x - \sqrt 3$

$w_2 = x^2\\ e_2^* = w_2 - \langle e_0,w_2\rangle - \langle e_1,w_2\rangle$

Normalize it...

lather, rinse, repeat.