I'm currently learning Linear Algebra and I was asked to calculate the orthogonal projection of the vector $x^3$ on a subspace of $R_5[x]$ - $U = Sp\{1, x, x^2\}$ with the integral dot product in $[0,1]$.

I'm trying to get the orthogonal base of $U$, but I'm having trouble with the Gram-Schmidt process.

Can someone please help me get the orthogonal base of $U$? I keep getting the same non-orthogonal base using the Gram-Schmidt process...

The base I get is $\{1, x-\frac12, x^2-x-\frac56\}$, and the dot product of the last two vectors isn't zero...

  • $\begingroup$ For us to find your error, you must show us your calculations. $\endgroup$
    – GEdgar
    Mar 30, 2018 at 11:59
  • $\begingroup$ Let's mark $v_1=1, v_2=x, v_3=x^2$. $u_1=v_1=1$, $u_2 = v_2 - <v_2, u_1>/<u_1, u_1> = x - 1/2$, $u_3 = v_3 - <v_3, u_1>/<u_1, u_1> - <v_3, u_2>/<u_2, u_2> = x^2-x-5/6$ $\endgroup$
    – Ofek Inger
    Mar 30, 2018 at 13:04
  • $\begingroup$ That doesn’t really show your calculations. My guess is that you’re making some error in computing an inner product. Try doing this orthogonalization in $\mathbb R^3$ instead, with the inner product $\langle x,y\rangle = x^TAy$ for a suitable matrix $A$. Computing $A$ only involves integrating $x^0$ through $x^4$, so there’s little room for error there. $\endgroup$
    – amd
    Mar 30, 2018 at 17:43

1 Answer 1


There's another problem with your answer: the second and the third functions don't have norm $1$. Did you forget to divide by the norm? What I got was$$\bigl\{1,\sqrt3(2x-1),\sqrt5\left(6x^2-6x+1\right)\bigr\}.$$

  • $\begingroup$ After normalizing the vectors I got the same results, but the last two vectors are still not orthogonal... $\endgroup$
    – Ofek Inger
    Mar 30, 2018 at 12:42
  • 1
    $\begingroup$ @OfekInger They are, in fact, orthogonal, so you’re likely making a mistake when computing their inner product. $\endgroup$
    – amd
    Mar 30, 2018 at 17:36
  • $\begingroup$ @OfekInger Did you really think that I posted this without checking whether or not it was really an orthonormal basis? $\endgroup$ Mar 30, 2018 at 17:38
  • $\begingroup$ BTW, the OP only wants an orthogonal basis, so normalization is optional. $\endgroup$
    – amd
    Mar 30, 2018 at 17:52
  • $\begingroup$ @amd Thank you for that observation. I had not noticed it. $\endgroup$ Mar 30, 2018 at 18:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .