Alice hit x home runs.
Peter hit twice the difference of the number of home runs Alice hit and 6, so he hit 2(x-6) home runs.
Altogether they hit 18 home runs.
[tex]x+2(x-6)=18 \\
x+2x-12=18 \\
3x-12=18 \\
3x=18+12 \\
3x=30 \\
x=\frac{30}{3} \\
x=10 \Leftarrow \hbox{the number of home runs Alice hit} \\ \\
\hbox{the number of home runs Peter hit:} \\
2(x-6)=2(10-6)=2 \times 4=8[/tex]
Alice hit 10 home runs, Peter hit 8 home runs.