# How to prove the following for inner product and positive semidefinite matrices?

In the solution of problem 2.10(b) of Stephen Boyd & Lieven Vandenberghe's Convex Optimization, it is mentioned that if

$$g^Tv = 0, \qquad v^TAv \geq 0 \qquad \forall v$$

where $A$ is a positive semidefinite matrix and $g$ is a vector with real elements), then there must exist $\lambda$ such that $A+\lambda gg^T$ is positive semidefinite. How to obtain this?

Here is the solution image which I am talking about:

• You need to provide more details. What is given here? $A$ and $g$? What about $v$? For all $v$? etc. May 15 '18 at 3:34
• If $g^T v=0$ for all $v$ then $g=0$. May 15 '18 at 3:41
• @NicNic8 no $g^Tv$ is not zero for all $v$ but $v^TAv\geq 0$ for all $v$ May 15 '18 at 3:44
• @FrankMoses: If $v^T A v \geq 0$ for all $v$ then you can choose $\lambda =0$ (as $A$ is already semidefinite). May 15 '18 at 3:48
• @Fabian can you please explain why I cannot chose any value I like because $g^Tv=0$? May 15 '18 at 3:52

From what's given, $A$ is positive semidefinite. Therefore,