Suppose $v \in \mathbb R^n$ is a fixed vector. We define a scalar-valued function on $n \times n$ matrices $f: M_n(\mathbb R) \to \mathbb R$ by \begin{align*} A \mapsto \sum\limits_{j=0}^{\infty} \langle A^j v, A^j v \rangle. \end{align*} Let us denote the domain of $f$ by $\text{Dom}(f) = \{A \in M_n(\mathbb R): f(A) < \infty\}$.
It is clear if $\rho(A) < 1$ (spectral radius), then $A \in \text{Dom}(f)$. If I am not mistaken, $f$ should also be differentiable on $\{A: \rho(A) < 1\}$. On the other hand, if $\rho(A) \ge 1$, it is still possible $A \in \text{Dom}(f)$. For example, if $v$ is chosen to be an eigenvector corresponding to an eigenvalue strictly smaller than $1$.
The question bugs me is: could the function be differentiable on the set $\text{Dom(f)} \setminus \{A:\rho(A) < 1\}$.