# How can I simplify this equation?

How can I simplify this equation : $$P=s^{T}_1A^{-1}y-\frac{1}{2}s^{T}_1A^{-1}s_1-s^{T}_0A^{-1}y+\frac{1}{2}s^{T}_0A^{-1}s_0 \tag1$$ as below equation: $$P=(s_1-s_0)^TA^{-1}\left(y-\frac{s_0+s_1}{2}\right).\tag2$$

where T is transpose sign, $s_1,s_0,y$ are vectors and A is positive definite matrix.

-

## 1 Answer

We have (as positive definite means also symmetric, that $s_0^tA^{-1}s_1 = s_1^tA^{-1}s_0$): \begin{align*} (s_1 - s_0)^tA^{-1}\left(y - \frac{s_0+s_1}2\right) &= s_1^tA^{-1}y - s_0^tA^{-1}y - \frac 12 s_1^tA^{-1}s_0 + \frac 12 s_0^tA^{-1}s_0 - \frac 12 s_1^tA^{-1}s_1 + \frac 12 s_0^tA^{-1}s_1\\ &= s_1^tA^{-1}y - \frac 12 s_1^tA^{-1}s_1 - s_0^tA^{-1}y + \frac 12s_0^tA^{-1}s_0\\ &= P \end{align*}

-
@ martini: I have eq(1) and want to get eq(2)? – roxab Nov 23 '12 at 8:26
Read it the other way. Equality is symmetric. Just add $0 = \frac 12 s_0^tA^{-1}s_1 - \frac 12 s_1^tA^{-1}s_0$ – martini Nov 23 '12 at 8:28
@ martini: Thank you! – roxab Nov 23 '12 at 8:38