The Fence is a rectangle with one length missing because of wall.
The 2 comes since x is length of the left side and x is the length of right side(since opposite sides of rectangle are equal) of fence.So x+x=2x.I don't understand where they get the equation "48.5 - 2x" from
We are given total perimeter of fence to be 48.5.Now the length of rectangle(on the top) is (48.5-2x) and breadth(right one or left one,doesn't matter) is x.Therefor y(area of rectangle)=breadth*length=x*(48.5-2x).
Hope it helps.
P.S. How old are you??