Bob has $120m$ of fencing. He is planning on building a rectangular enclosure for his cows. He will build the enclosure alongside his barn and will fence in the remaining three sides. Determine the dimensions that will result in the maximum area.
Answer: Max area of $1800m^2$ when the dimensions are $60m$ x $30m$
I started with $$2x+y=120$$ And changed it to $$y=120-2x$$ Which I substituted into the equation for area ($A=xy$) $$A=x(120-2x)$$ I expanded this then completed the square and got $$-2(x-60)^2 +1800$$
Now I'm confused, I thought the vertex would be the two sides, but I got 60, which is one of the answers. I thought maybe I would plug 60 back into the original equation to get the other side but $120-2*60=0$ and zero can't be the other side. Any help is greatly appreciated.
From here
$$A=x(120-2x)$$
completing the square we obtain
$$A=-2x^2+120x=-2(x-30)^2+1800$$
from which we obtain $x=30$.