Let $f(X) =\left( XC + D\right)M\left(XC + D \right)^{*} - G$ be a given nonlinear Hermitian matrix-valued function with $M = M^*$ and $G = G^*$, and assume that the variable matrix $X$ satisfies the consistent linear matrix equation $XA = B$. This paper shows how to characterize the semi-definiteness of $f(X)$ subject to all solutions of $XA = B$. As applications, a standard method is obtained for finding analytical solutions $X_0$ of $X_0A = B$ such that the matrix inequality $f(X) \succcurlyeq f(X_0)$ or $f(X) \preccurlyeq f(X_0)$ holds for all solutions of $X\!A = B$. The whole work provides direct access, as a standard example, to a very simple algebraic treatment of the constrained Hermitian matrix-valued function and the corresponding semi-definiteness and optimization problems.