The following is a worked example:

In the very first line of working, I don't understand how they've got $\displaystyle (g,h)=(x+1,x^2+1)=(1,x^2+1)$. I mean, how did they get "x+1" equal to "1"?

This is my own approach by the way:

$\displaystyle proj_{h(x)}g(x)= \frac{(g,h)}{(h,h)}h=$$\displaystyle \frac{\int^1_{-1}(x^2+1)(x+1)}{\int^1_{-1}(x^2+1)^2}(x^2+1)$

Since $\displaystyle \int^1_{-1} (x^2+1)(x+1)dx =4$ and $\displaystyle \int^1_{-1}(x^2+1)^2 dx= 8$, we have:

$\displaystyle \frac{4}{8}(x^2+1)=\frac{1}{4}(x^2+1)$

So, I've got 1/4, but it should've been 5/7 as the provided answer indicates. Could anyone please help?