
for first case if b in C(A) then p=Ax ⇒ Pb=A(AtA)-1AtAx⇒Ax⇒p hence Pb=Ax=b
for second case if b in null space of At or perpendicular to C(A) then Atb=0⇒Pb=A(AtA)-1Atb⇒ 0⇒Pb=0

p is the projected vector on the column space of A and e is the projected part on the null space of At



p1 p2 p3 points on the line closest to the original points b1 b2 b3.
the vector [p1,p2,p3] will be in the columns space and the projection of the b vector [b1,b2,b3] onto the column space which is closest combination of the basis vectors of the column space.


a different lens of looking at the same problem


using calculus if we take partial derivatives with respect to C and D we will get the same equations as what we got from linear algebra

