We have the next information
EF=2x-12
FG=3x-15
EG=23
With the information above we can have the next equation in order to find x
2x-12+3x-15=23
Then we sum similar terms
5x-27=23
then we isolate the x
5x=23+27
5x=50
x=10
then we substitute the value of x for each segment
EF=2x-12=2(10)-12=20-12=8
FG=3x-15=3(10)-15=30-15=15