Given $\lambda$ and $A$, find $v$ such that $\lambda = v^{\intercal}Av$

If I know the values of $\lambda$ and $A$, how do I find a vector $v$ such that $\lambda = v^{\intercal}Av$?

This isn't a homework question; I just ran into this problem in Real Life and realized I couldn't solve it!

• Nothing special about your $A$? Jul 23 '12 at 18:05
• Well it's positive definite, if that's necessary to solve it.
– Rag
Jul 23 '12 at 18:05
• @Cocopuffs A is positive definite and $\lambda$ will be greater than 0. I didn't realize these details would be relevant :) What do you mean by matrix square root? If you add an answer I'll accept it.
– Rag
Jul 23 '12 at 18:06
• @Brian, the devil is often in the details. Most problems in linear algebra only become tractable because there is exploitable structure or symmetry in them... Jul 23 '12 at 18:09
• If $A$ is a positive definite symmetric matrix then for given $\lambda>0$ the equation $v^TAv=\lambda$ describes an ellipsoid centered at the origin. Jul 23 '12 at 19:09

Start with any vector $v$ such that $v^{\intercal}Av\ne0$ and then
$$v\rightarrow\sqrt{c}\ v\ \Longrightarrow\ v^{\intercal}Av\rightarrow c\ v^{\intercal}Av,$$
If $A$ is positive definite then for any $\lambda>0$ pick any vector $v\not=0$ and compute $$c=v^TAv$$ Then $$v\sqrt{\frac{\lambda}{c}}$$ satisfies your equation.
Well, if $A$ is positive-definite one may compute a Cholesky decomposition $$A = U^{\intercal} U$$ where $U$ is an upper triangular matrix, so your equation reduces to $$||Uv||^2=\lambda$$ Pick any vector $y$ on the $n$-sphere of radius $\sqrt\lambda$, solve $$Uv=y$$ for $v$ - which should be trivial, since, as I said above, $U$ is upper triangular - and you've found your solution.
Of course this solution is immensely more expensive from a computational standpoint, but it has the advantage that it gives you a way to generate all possible solutions by varying $y$.