So if I understand this correctly, this would look something like this:
A first number
let's call it x
plus twice a second number
let's call the second number y:
x+2y=5
is 5.
this means that x=5-2y!
twice the first number plus the second totals 31.
2x+y=31
from the last one, i know that y=31-2x
and i can insert it into the first equation:
So i know that x=5-2y
and that
2x+y=31
i will substitute x here
2(5-2y)+y=31
remove the bracket
10-4y+y=31
10-3y=31
remove 10 from both sides
-3y=21
then
y=-7
and
x=5-2(-7)=5+14=19