How to identify the ratio of oxidation states in terbium ions in its mixed oxide?
There is certainly a formal way. Let $x$ and $y$ be the number of $\ce{Tb^3+}$ and $\ce{Tb^4+}$ ions respectively. Then:

$$\begin{align}
3x + 4y &amp;= 22 \\
x + y &amp;= 6
\end{align}$$

This is a simple system of two linear equations in two unknowns, and I am sure you know of many ways to solve it. Let's just solve it using matrices for the fun of it:

$$\begin{align}
\begin{pmatrix}
3 &amp; 4 \\
1 &amp; 1
\end{pmatrix}
\begin{pmatrix}
x \\
y
\end{pmatrix} &amp;=
\begin{pmatrix}
22 \\
6
\end{pmatrix} \\
\begin{pmatrix}
x \\
y
\end{pmatrix} &amp;= \frac{1}{3\cdot 1 - 1\cdot 4}
\begin{pmatrix}
1 &amp; -4 \\
-1 &amp; 3
\end{pmatrix}
\begin{pmatrix}
22 \\
6
\end{pmatrix} \\
&amp;= -
\begin{pmatrix}
1\cdot 22 - 4\cdot 6 \\
-1 \cdot 22 + 3\cdot 6
\end{pmatrix} \\
&amp;= \begin{pmatrix}
2 \\
4
\end{pmatrix}
\end{align}$$

as you found. It seems that trial and error may well be faster!