I need an analytical solution for finding inverse of a matrix in terms of an unknown.
I will use following example to pose my question
EXAMPLE:
- $\mathbf{H}$ is a $49\times 49$ matrix.
- $rank(\mathbf{H})$ is 49. (full rank matrix)
- $i^{th}$ column of $\mathbf{H}$ is denoted as $\mathbf{h}_i$
- $\mathbf{M}$ is a matrix defined as
\begin{equation} \mathbf{M}=\begin{bmatrix}\mathbf{H}^{}\mathbf{H}^{T}&\mathbf{h}_{25}^{}+p\mathbf{h}_{32}^{}\\\mathbf{h}_{25}^{T}+p\mathbf{h}_{32}^{T}&1+p^2\end{bmatrix} \end{equation}
I need to compute $\mathbf{M}^{-1}$ in terms of unknown $p$. Can we have a closed form expression for this? Is it possible to keep $\mathbf{H}^{}\mathbf{H}^{T}$ intact solution?
I believe your matrix $\ \mathbf{M}\ $ is singular.
More generally, if \begin{equation} \mathbf{M}=\begin{bmatrix}\mathbf{A}&\mathbf{b}\\\mathbf{b}^{T}&c\end{bmatrix}\ , \end{equation} where $\ \mathbf{A}\ $ is a non-singular symmetric square matrix, $\ \mathbf{b}\ $ a column vector with the same number of rows as $\ \mathbf{A}\ $, and $\ c\ $ is a scalar, and \begin{equation} \mathbf{M}^{-1}=\begin{bmatrix}\mathbf{D}&\mathbf{e}\\\mathbf{e}^{T}&f\end{bmatrix}\ , \end{equation} then it follows from the equation \begin{eqnarray} \begin{bmatrix}\mathbf{I}&\mathbf{0}\\\mathbf{0}^T&1 \end{bmatrix}&=& \mathbf{M}\mathbf{M}^{-1}\\ &=&\begin{bmatrix}\mathbf{A}&\mathbf{b}\\\mathbf{b}^{T}&c\end{bmatrix}\begin{bmatrix}\mathbf{D}&\mathbf{e}\\\mathbf{e}^{T}&f\end{bmatrix}\\ &=& \begin{bmatrix} \mathbf{A}\mathbf{D}+\mathbf{b}\mathbf{e}^T&\mathbf{A}\mathbf{e}+f\,\mathbf{b}\\ \mathbf{b}^T\mathbf{D}+c\,\mathbf{e}^T& \mathbf{b}^T\mathbf{e}+c\,f \end{bmatrix} \end{eqnarray} that $\ \mathbf{e} = -f\,\mathbf{A}^{-1}\mathbf{b}\ $ and $\ f \left(c-\mathbf{b}^T\mathbf{A}^{-1}\mathbf{b}\right)=1\ $. Thus, the inverse $\ \mathbf{M}^{-1}\ $ can exist only if $\ c-\mathbf{b}^T\mathbf{A}^{-1}\mathbf{b}\ne 0\ $. If this condition is satisfied, then we get \begin{eqnarray} f &=& \left(c-\mathbf{b}^T\mathbf{A}^{-1}\mathbf{b}\right)^{-1}\ ,\\ \mathbf{e} &=& -f\,\mathbf{A}^{-1}\mathbf{b}\ ,\mbox{ and}\\ \mathbf{D} &=& \mathbf{A}^{-1}-f\,\mathbf{A}^{-1}\mathbf{b}\mathbf{b}^T\mathbf{A}^{-1}\ . \end{eqnarray} and with these values, it is easy to check that $\ \begin{bmatrix}\mathbf{D}&\mathbf{e}\\\mathbf{e}^{T}&f\end{bmatrix}\ $ is indeed the inverse of $\ \mathbf{M}\ $.
In your case, $\ \mathbf{A}=\mathbf{H}\mathbf{H}^T\ $, $\ \mathbf{b}=\mathbf{h}_{25}+p\,\mathbf{h}_{32}\ $, and $\ c=1+p^2\ $, so the condition required for the inverse to exist becomes \begin{equation} 1+p^2-\left(\,\mathbf{h}_{25}+p\,\mathbf{h}_{32}\right)^{T}\left(\mathbf{H}^{T}\right)^{-1}\mathbf{H}^{-1}\left(\,\mathbf{h}_{25}+p\,\mathbf{h}_{32}\right)\ne 0\ . \end{equation} But $\ \mathbf{H}^{-1}\left(\,\mathbf{h}_{25}+p\,\mathbf{h}_{32}\right)= \mathbf{i}_{25}+p\,\mathbf{i}_{32}\ $, where $\ \mathbf{i}_i\ $ is the $\ i^\mathrm{\,th}\ $ column of the $\ 49\times49\ $ identity matrix, so \begin{eqnarray} \left(\,\mathbf{h}_{25}+p\,\mathbf{h}_{32}\right)^{T}\left(\mathbf{H}^{T}\right)^{-1}\mathbf{H}^{-1}\left(\,\mathbf{h}_{25}+p\,\mathbf{h}_{32}\right)&=&\left( \mathbf{i}_{25}+p\,\mathbf{i}_{32}\right)^T\left( \mathbf{i}_{25}+p\,\mathbf{i}_{32}\right)\\ &=& 1 + p^2\ , \end{eqnarray} and the condition required for the inverse to exist is not satisfied.
Direct demonstration that $\ M\ $ is singular
First note that the matrix $$ \begin{bmatrix}\mathbf{H}^{T}&\mathbf{i}_{25}^{}+p\,\mathbf{i}_{32}^{}\\\mathbf{h}_{25}^{T}+p\,\mathbf{h}_{32}^{T}&1+p^2\end{bmatrix} $$ is singular because its $50^\mathrm{th}$ row is the sum of its $25^\mathrm{th}$ row and $\ p\ $ times its $32^\mathrm{nd}$ row. Thus, \begin{eqnarray} \mathbf{M}&=&\begin{bmatrix}\mathbf{H}^{}\mathbf{H}^{T}&\mathbf{h}_{25}^{}+p\,\mathbf{h}_{32}^{}\\\mathbf{h}_{25}^{T}+p\,\mathbf{h}_{32}^{T}&1+p^2\end{bmatrix}\\ &=&\ \begin{bmatrix} \mathbf{H} &\mathbf{0}\\ \mathbf{0}^T & 1 \end{bmatrix}\begin{bmatrix}\mathbf{H}^{T}&\mathbf{i}_{25}^{}+p\,\mathbf{i}_{32}^{}\\\mathbf{h}_{25}^{T}+p\,\mathbf{h}_{32}^{T}&1+p^2\end{bmatrix}\ , \end{eqnarray} as a product of one matrix with another singular matrix, is also singular.