We have 2 numbers. We can call them x and y, being x the smaller one.
The sum of this two numbers is 40, so we can write:
[tex]x+y=40[/tex]We know that if 2 is added to the larger number (that we name as y), the result is twice the smaller number, that would be 2x. Then, we can express this as:
[tex]y+2=2x[/tex]We can express y in function of x from the second equation and then replace it in the first equation to solve for x:
[tex]y+2=2x\Rightarrow y=2x-2[/tex][tex]\begin{gathered} x+y=40 \\ x+(2x-2)=40 \\ 3x-2=40 \\ 3x=40+2 \\ 3x=42 \\ x=\frac{42}{3} \\ x=14 \end{gathered}[/tex]Now, we can calculate y as:
[tex]\begin{gathered} y=2x-2 \\ y=2(14)-2 \\ y=28-2 \\ y=26 \end{gathered}[/tex]Answer: the two numbers are 14 and 26.