# Vector projection problem

1. Feb 17, 2008

### msimmons

Problem:
Let $$\vec{x}$$ and $$\vec{y}$$ be vectors in Rn and define

$$p = \frac{x^Ty}{y^Ty}y$$
and
$$z = x - p$$

(a) Show that $$\vec{p}\bot\vec{z}$$. Thus $$\vec{p}$$ is the vector projection of x onto y; that is $$\vec{x} = \vec{p} + \vec{z}$$, where $$\vec{p}$$ and $$\vec{z}$$ are orthogonal components of $$\vec{x}$$, and $$\vec{p}$$ is a scalar multiple of $$\vec{y}$$

(b) If $$||\vec{p}|| = 6$$ and $$||\vec{z}|| = 8$$, determine the value of $$||\vec{x}||$$

My problem:
I understand the question, but have no idea how to approach it. Hints?

2. Feb 18, 2008

### trambolin

Draw any arbitrary two vectors, draw the projection of one onto the other and stare at it until you realize that $$\sqrt{6^2 + 8^2}$$ is obvious.

3. Feb 18, 2008

### HallsofIvy

And then think "3-4-5 right triangle" twice! :rofl:

Your "$x^T y$ is a fancy way of writing the dot product. In my simpler mind, what you really want to prove is that
$$\frac{\vec{x}\cdot\vec{y}}{||\vec{x}||} \vec{x}$$
is perpendicular to $\vec{p}- \vec{x}$.

Okay, go ahead and take the dot product:
[tex]\frac{\vec{x}\cdot\vec{y}}{||\vec{x}||} \vec{x}\cdot (\vec{x}- \frac{\vec{x}\dot\vec{y}}{||\vec{x}||} \vec{x})[/itex]