# Confusion in matrix manipulation

I have a vector $y = \frac{-x^TB}{C}$

Substituting y in $x^TAx + 2x^TBy+y^TCy$ I am supposed to get

$x^T(A-BC^{-1}B^T)x$

I am just beginner with matrix stuff. Obviously, substituting y in the equation should give the results, but I am having some problem with playing around with the properties of the matrices to get the exact result. Can anyone give me good pointer which will help me to get a good grasp of it? I am not able to manipulate using the properties of the matrices to get this

-

## migrated from stats.stackexchange.comJan 10 '13 at 8:13

This question came from our site for people interested in statistics, machine learning, data analysis, data mining, and data visualization.

To get a vector $y$ making the identity $x^TAx+2x^TBy+y^TCy=x^T(A-BC^{-1}B^T)x$ true, one must assume that $C$ is symmetric (and invertible). Then $y=-C^{-1}B^Tx$ works.
About your solution: what is $-\frac{x^TB}C$ for a matrix $C$ is unclear; likewise, as soon as the matrices are not of size $1\times1$, the formula you suggest runs into dimension problems which make that some products in it simply do not exist. Recall that the product of matrices $MN$ exists if and only if the dimensions of $M$ and $N$ are $i\times j$ and $j\times k$ respectively, for some $i$, $j$ and $k$, and that vectors in $\mathbb R^n$ or $\mathbb C^n$ have dimension $n\times 1$.