# Manipulation of quadratic form

How is this derivation obtained? It seems like it is possible to do so from first principles for using the series definition for quadratic form, but that seems tedious. Is there a faster way to manipulate such forms?

• Sure! This is from page 11 of the Seber and Lee's Linear Regression Analysis
– shem
Commented Mar 6, 2021 at 15:56

## 1 Answer

Assuming $$\mathsf X$$ and $$\mathsf \theta$$ to be vectors, and $$\mathsf A$$ to be symmetric, \begin{align}\mathsf{ X^T A X=(X-\theta+\theta)^T A (X-\theta+\theta)\\ =(X-\theta)^T A (X-\theta)+\theta^T A (X-\theta)+\theta^T A\theta+(X-\theta)^T A \theta\\ =(X-\theta)^T A (X-\theta)+2\theta^T A (X-\theta)+\theta^T A\theta}\end{align} since $$\mathsf{ \theta^T A (X-\theta)=[\theta^T A (X-\theta)]^T=(X-\theta)^T A \theta }$$

• Just to be clear, since I took some time to go from line 1 to line 2.\begin{align}\mathsf{ X^T A X=(X-\theta+\theta)^T A (X-\theta+\theta)\\ =(X-\theta)^T A (X-\theta+\theta) + (\theta)^T A (X-\theta+\theta) \\ =(X-\theta)^T A (X-\theta) + (X-\theta)^T A (\theta) + (\theta)^T A (X-\theta) + (\theta)^T A (\theta) \\ =(X-\theta)^T A (X-\theta)+\theta^T A (X-\theta)+\theta^T A\theta+(X-\theta)^T A \theta\\ =(X-\theta)^T A (X-\theta)+2\theta^T A (X-\theta)+\theta^T A\theta} \end{align}
– shem
Commented Mar 6, 2021 at 15:55