Can we derive the formula $Q=I_3+\frac{1}{2}(B+S)$ instead of accepting it as an empirical relation? The electric charge of a quark or lepton, $Q$, is related to the third component of the weak Isospin $T_3$ and weak hypercharge $Y$ according to the formula $$Q=T_3+\frac{Y_W}{2}.\tag{1}$$ This, in a sense, is derived in the Standard electroweak theory, by identifying the unbroken diagonal generator after the spontaneous breakdown of $$SU(2)_L\times U(1)_{Y_W}\to U_Q(1)$$ takes place.
On the other hand, the electric charge $Q$ of a quark or a hadron also obeys a similar relation $$Q=I_3+\frac{1}{2}(B+S)\tag{2}$$ where $I_3$ denotes the third component of the strong Isospin, $B$ and $S$ denote the baryon number and the strangeness quantum number, respectively.
Relation $(1)$, is derived in the Standard Model in the sense explained above. My question is: "is the relation $(2)$, to be derived instead of accepting it as an empirical relation?"
 A: If you take pure QCD with massless $u$, $d$ and $s$ quarks, hadrons form multiplets of $U(3)$. This means that they can be characterized by three quantum numbers that are the eigenvalues of the three generators of the Cartan sub-algebra of $U(3)$.
If you take the usual Gell-Mann generators, these would be the identity matrix, $\lambda_3$ and $\lambda_8$, but any linear combination of these will work. In particular you can use

*

*$B = \mathrm{diag}(1/3, 1/3, 1/3)$

*$I_3 = \mathrm{diag}(1/2, -1/2, 0)$

*$S = \mathrm{diag}(0, 0, -1)$
This is a perfectly valid basis for the Cartan sub-algebra and it is the one most commonly used for hadrons.
The $U(3)$ symmetry is however explicitly broken by the electric charge. In particular, a $U(1)$ subgroup of $U(3)$ is gauged by the photon. This $U(1)$ is the one generated by $$Q=\mathrm{diag}(2/3,-1/3,-1/3)$$
Since this $U(1)$ is a subgroup of $U(3)$, its generator must be linearly dependent on $B$, $I_3$ and $S$ and in particular you find
$$Q=I_3 + \frac{1}{2}(B+S)$$
The bottom line is that this equation is just telling you that the $U(3)$ states are described by three quantum numbers. Among these $Q$ is special, because it comes from gauging a specific subgroup of $U(3)$, while $B$, $S$ and $I_3$ are an arbitrary parametrization of the Cartan sub-algebra. Since this sub-algebra is $3$-dimensional, these quantities must be linearly related.
