We have analyzed the magnetic field dependencies of the intensities of all the optical transitions between magnetic sublevels of hyperfine levels, excited with
σ
+
,
π
, and
σ
−
polarized light, for the
D
1
and
D
2
lines of
87
R
b
and
85
R
b
atoms. Depending on the type of transition and the quantum numbers of the involved levels, the Hamiltonian matrices are of
1
×
1
,
2
×
2
,
3
×
3
, or
4
×
4
dimension. As an example, analytical expressions are presented for the case of
2
×
2
dimension matrices for the
D
1
line of both isotopes. Eigenvalues and eigenkets are given, and the expression for the transition intensity as a function of
B
has been determined. It is found that some
π
transitions of
87
R
b
and
85
R
b
get completely canceled for certain, extremely precise, values of
B
. No cancellation occurs for
σ
+
or
σ
−
transitions of the
D
1
line. For matrices with a size over
2
×
2
, analytical formulas are heavy, and we have performed numerical calculations. All the
B
values canceling
σ
+
,
π
, and
σ
−
transitions of the
D
1
and
D
2
lines of
87
R
b
and
85
R
b
are calculated, with an accuracy limited by the precision of the involved physical quantities. The experimental implementation feasibility and its possible outcome are addressed. We believe the experimental realization will allow an increase in the precision of the physical quantities involved, in particular the upper state atomic level energy.