A three-sided fence is to be built next to a straight section of river, which forms the fourth side of a rectangular region, as shown in the diagram below. The enclosed area is to equal $1800 m^2$ and the fence running parallel to the river must be set back at least $20 m$ from the river. Determine the minimum perimeter of such an enclosure and the dimensions of the corresponding enclosure.
I am using this for the first part: $1800m^2 = l(w- 20)$
Every time I use this I can't really figure out how to differentiate, which leads me to believe I'm doing something wrong. I know that one of the sides needs to be subtracted by $20$, but I can't understand when it should be subtracted.
Also, if I do find the new width, would that change the entire area?
We have $$1800 = l \cdot w$$
where $$l \ge 20$$
We want to minimize $2l+w$.
The Lagrangian is given by $$\mathcal{L}(l)= 2l + 1800/l +\lambda(20-l)$$
Then, $$\frac{d}{dl}\mathcal{L}(l)= 2 - l^{-2} 1800 -\lambda$$
We conclude that
$$\frac{1}{l}=\sqrt{\frac{2-\lambda}{1800}}$$
Therefore, if $\lambda=0$,
$$\frac{1}{l}=\sqrt{\frac{2}{1800}}$$
then $l=30$, which is the solution.
Candidate solutions: $l=20$ and $w=90$ or $l=30$ and $w=60$.
Solution: $l=30$ and $w=60$.
Alternative problem: We want to minimize $2(l+w)$.
The Lagrangian is given by $$\mathcal{L}(l)= 2(l + 1800/l) +\lambda(20-l)$$
Then, $$\frac{d}{dl}\mathcal{L}(l)= 2(1 - l^{-2} 1800) -\lambda$$
We conclude that
$$\frac{1}{l}=\sqrt{\frac{1-\lambda/2}{1800}}$$
Therefore, either $\lambda=0$, implying that $l = w = \sqrt{1800}$ or $l=20$ and $w=90$.
Solution: $l=w=\sqrt{1800}$.