# Completing the square in N dimensions

Another one of those things that I’ve had to re-derive 100 times, and so I am posting here for future reference.

Take a quadratic equation for a vector .

.

You want to convert this into the form

.

What are , , and ?

First, assume is **symmetric**. Then we have, in decreasing order of obviousness,

Now, suppose is **non-symmetric**. (Of course, still being symmetric is okay, but you would be using a needlessly complicated formula…) Then,

### Like this:

Like Loading...

I like this. Seems like all of numerics is reducing nonlinear problems to linear ones. Always wondered if there was a generalization of the quadratic equation to operators but never got this far..

love it! Many thanks.

Decompose the matrix in the quadratic term as C = S + K, where S is symmetric and K is skew.

Since x’Kx = 0, without loss of generality you can replace C with S = (C + C’) / 2

in the function definition .

Then the formulae for the symmetric case apply for any matrix, after substituting S for C.

Pingback: About the ‘completing the square’ – Liming Shi's Homepage

In your formula for v the factor should be 1/4 and not 1/2, right?

Look at page 245 here: https://books.google.com/books?id=7Vq-CgAAQBAJ&printsec=frontcover&dq=Fundamentals+of+Matrix+Analysis+with+Applications&hl=en&sa=X&ved=0ahUKEwj4_PmH5enSAhXDMGMKHUi5A3YQ6AEIGjAA#v=onepage&q=Fundamentals%20of%20Matrix%20Analysis%20with%20Applications&f=false