Let be an complex Hermitian matrix, be an complex matrix, be an complex Hermitian matrix, be an complex matrix, be a variable matrix and denotes the conjugate transpose of a complex matrix.
In this paper, the author presents a useful algebraic linearization method, which can convert the calculations of ranks and inertias of quadratic Hermitian matrix-valued functions (QHMF) into those of ranks and inertias of certain linear matrix-valued functions, then the author establishes a group of explicit formulas in closed form for calculating the global maximum and minimum ranks and inertias of this matrix-valued function with respect to the variable matrix . As applications of these rank and inertia formulas, the author characterizes a variety of solvability conditions for some quadratic matrix equations and inequalities generated from . In particular, the author gives analytical solutions to the two well-known classic optimization problems on the QHMF in the Löwner partial ordering. The results obtained and the techniques adopted for solving the matrix rank and inertia optimization problem enable us to make many new extensions of some classic results on quadratic forms, quadratic matrix equations and quadratic matrix inequalities.