I want to show that $$\left(\frac{1}{x^Tx} x^TA(\sigma^2A + xx^T)^{-1}x\right)^{-1} = \sigma^2 + x^TA^{-1}x$$ where $A$ is symmetric and positive definite.
The following python program indicates that it is true because the difference between the left- and the right-hand side is always relatively small ($< 10^{-4}$). However, I don't know how to proceed.
To speak informally, I think I need to somehow move the inverse from $(\sigma^2A + xx^T)^{-1}$ to the $A$ because then everything falls into place but I don't see how.
import numpy as np
from numpy.linalg import *
# Sample matrices and data
d = 10
sigma2 = np.random.rand() + 0.0001
A = np.random.randn(d, d)
x = (np.random.rand(d) - 0.5) * 1000
# Ensure invertibility
assert det(A) != 0.0
left = 1/(1 / (x @ x) * x.T @ A @ inv(sigma2 * A + np.outer(x, x)) @ x)
right = sigma2 + x.T @ inv(A) @ x
abs(left - right)
# usually on the order of 10^-5 because of instability in the matrix
# inversion I guess
By the Sherman Morrison formula, we have $$ \begin{align} (\sigma^2 A + xx^T)^{-1} &= \sigma^{-2} A^{-1} - \sigma^{-4}\frac {A^{-1}xx^T A^{-1}}{1 + \sigma^{-2} x^\textsf{T}A^{-1}x} \\ & = \sigma^{-2} A^{-1} - \sigma^{-2}\frac {A^{-1}xx^T A^{-1}}{\sigma^2 + x^\textsf{T}A^{-1}x} \\ & = \sigma^{-2} \left[A^{-1} - \frac {A^{-1}xx^T A^{-1}}{\sigma^2 + x^\textsf{T}A^{-1}x}\right]. \end{align} $$ It follows that $$ \begin{align} x^TA(\sigma^2 A + xx^T)^{-1}x &= \sigma^{-2} x^TA\left[A^{-1} - \frac {A^{-1}xx^T A^{-1}}{\sigma^2 + x^\textsf{T}A^{-1}x}\right]x \\ & = \sigma^{-2} x^TAA^{-1}x - \sigma^{-2}x^TA\frac {A^{-1}xx^T A^{-1}}{\sigma^2 + x^\textsf{T}A^{-1}x}x \\ & = \sigma^{-2} x^Tx - \sigma^{-2}\frac {x^Tx}{\sigma^2 + x^\textsf{T}A^{-1}x}x^T A^{-1}x \\ & = \sigma^{-2} x^Tx - \sigma^{-2}\frac {x^Tx}{\sigma^2 + x^\textsf{T}A^{-1}x}[\sigma^2 + x^T A^{-1}x] + \frac {x^Tx}{\sigma^2 + x^\textsf{T}A^{-1}x} \\ & = \sigma^{-2} x^Tx - \sigma^{-2}{x^Tx} + \frac {x^Tx}{\sigma^2 + x^\textsf{T}A^{-1}x} \\ & = \frac {x^Tx}{\sigma^2 + x^\textsf{T}A^{-1}x}. \end{align} $$ Your observation follows.