Why the projection of $e^x$ onto subspace of polynomials is given by this system:
Finding the orthogonal projection can also be done by solving for a,b, the system $$\langle 1,e^x-(a+bx)\rangle=0\\ \langle x,e^x-(a+bx)\rangle=0$$ or, in the matrix form, $$ \begin{pmatrix} \langle1,1\rangle & \langle 1,x\rangle \\ \langle x,1\rangle & \langle x,x\rangle\end{pmatrix} \begin{pmatrix}a\\b\end{pmatrix} =\begin{pmatrix}\langle 1,e^x\rangle\\\langle x,e^x\rangle\end{pmatrix}.$$
?
The orthogonal projection of a function $f$ onto a subspace $U$ is the unique function $g$ such that $$f=g+h,$$ with $g\in U$ and $h\in U^{\perp}$, i.e. $\langle h,u\rangle=0$ for all $u\in U$. Note that $h=f-g$.
In this case $f=e^x$ and $U=\operatorname{span}\{1,x\}$ so $g\in U$ means that $g=a+bx$ for some scalars $a$ and $b$, and hence $$h=f-g=e^x-(a+bx),$$ and we want $\langle h,u\rangle=0$ for all $u\in U$. Because $U=\operatorname{span}\{1,x\}$ it suffices to check that $$\langle h,1\rangle=0\qquad\text{ and }\qquad \langle h,x\rangle=0,$$ which yield precisely the given equations. Bilinearity of the inner product allows you to write this system of equations in the given matrix form.