Let x represent the first number and y represent the second number.

The second number is 2 more than 3 times the first number:

\(\displaystyle{y}={2}+{3}{x}\)

The sum of the two numbers is 22:

\(\displaystyle{x}+{y}={22}\)

Let us replace y by \(2+3x\) in the previous equation (as \(y=2+3x\) holds):

\(\displaystyle{x}+{\left({2}+{3}{x}\right)}={22}\)

Combine like terms:

\(\displaystyle{2}+{4}{x}={22}\)

Subtract 2 from each side:

\(\displaystyle{4}{x}={20}\)

Divide each side by 4:

\(\displaystyle{x}={5}\)

Thus we obtain that the first number is x=5

Let us then determmine the second number by evaluating \(\displaystyle{y}={2}+{3}{x}\) as \(\displaystyle{x}={5}\):

\(\displaystyle{y}={2}+{3}{x}={2}+{3}{\left({5}\right)}={2}+{15}={17}\)

Thus the two numbers are then 5 and 17.

Result: 5 and 17