In many basic derivations of the secular equations for the energy of two molecular orbitals from a linear combination of atomic orbitals, we see the following reasoning which I find confusing.
We have a trial wavefunction $\phi = c_a\psi_a + c_b\psi_b$
The energy of the trial wavefunction is
$$\begin{align} \langle E\rangle &= \frac{\langle \phi | H | \phi \rangle}{\langle \phi | \phi \rangle}\\ &= \frac{c_a^2H_{aa}+2c_a c_b H_{ab} + c_b^2 H_{bb}}{c_a^2 S_{aa} + 2c_a c_b S_{ab} + c_b^2 S_{bb}} \end{align}$$
Where $S_{aa}$ and $S_{bb}$ equal 1. Now per the variational principle, we take the partial derivatives with respect to the coefficients $c_a$ and $c_b$ and set them equal to zero to find the optimal coefficients to minimize $\langle E \rangle$.
But instead, things follow a different route. We take the equation and move the denominator over:
$$ \langle E \rangle (c_a^2 + 2c_a c_b S_{ab} + c_b^2) = {c_a^2H_{aa}+2c_a c_b H_{ab} + c_b^2 H_{bb}} $$
And then it's stated that this equation is differentiated with respect to $c_a$ and $c_b$ such that
$$ \langle E \rangle(2c_a + 2c_b S_{ab}) + \frac{\partial\langle E\rangle}{\partial c_a} (c_a^2 + 2c_a c_b S_{ab} + c_b^2) = 2c_a H_{aa} + 2c_b H_{ab} $$
with a similar expression for differentiation wrt $c_b$.
Now the partial derivatives are set to 0, such that you end up with
$$ c_a(H_{aa}-E) + c_b(H_{ab} - ES_{ab}) = 0 \\ c_a(H_{ab}-ES_{ab}) + c_b(H_{bb} - E) = 0 $$
which then you can solve for E.
Is my understanding correct that we've obtained the minimum energies in a single step by first rearranging the equations and then differentiating? Of course we do not obtain values for the coefficients. How is the approach valid?
THe final equations are called the secular equations, which for linear systems isa way of finding the eigenvalues of the system by $A - \lambda I = 0$. But here we have off-diagonal terms $-ES_{ab}$, so I do not see the connection to linear algebra here.