\documentclass[11pt]{article}
\def\Z{\mathbb{Z}}
\def\Q{\mathbb{Q}}
\usepackage{latexsym,amsmath,amssymb,float,graphicx,subfig}
\setlength{\textwidth}{6.5in}
\setlength{\oddsidemargin}{0in}
\setlength{\textheight}{8.6in}
\setlength{\topmargin}{-0.6in}
\begin{document}
\centerline{MATH 135 -- Calculus 1}
\centerline{Review on Optimization}
\centerline{December 9, 2019}
\vskip 10pt
\noindent
{\it Practice Problems}
\vskip 10pt
\noindent
Solve the following optimization problems:
\begin{enumerate}
\item Let $x,y$ be two non-negative numbers such that $2x + y = 100$.  What is the maximum value of 
$xy^2$?
\item[] \emph{Solution:}  From the equation $2x + y = 100$, we have $y = 100 - 2x$.  So we 
must find the maximum value of $f(x) = xy^2 = x(100 - 2x)^2$, and $x$ must lie in the 
interval $0 \le x \le 50$.  Expanding out, $f(x) = 10000x - 400x^2 + 4x^3$.  We first find 
any critical points in the interval $[0,50]$.  We have
$$f'(x) = 10000 - 800 x + 12 x^2 = 0$$
when 
$$x = \frac{800 \pm \sqrt{800^2 - 4\cdot 10000 \cdot 12}}{24} \doteq 16.7, 50.$$
\vskip 10pt
\item[] {\it Method 1:}  Both of the critical points are actually in the interval we 
are considering.  But if $x = 50$, then $y = 0$, so 
$xy^2 = 0$.  On the other hand if $x = 0$, then $y = 100$ and $xy^2 = 0$ again.  The value
$x \doteq 16.7$ gives $y \doteq 66.6$ and then $xy^2 = (16.7)(66.6)^2 \doteq 74073.9 > 0$. 
This is the maximum value.
\item[] {\it Method 2:}  Using the second derivative test, $f''(x) = -800 + 24x$.  At
$x = 16.7$ we have $f''(16.7) \doteq -399.2 < 0$.  Since this is negative, $f(x)$ has
a local maximum.  Moreover, this is the only critical point in the interval $[0,50]$,
so $f$ must also have an absolute or ``global'' maximum there.  
\item What is the maximum area of a rectangle inscribed in a $3-4-5$ right triangle?
 Assume the sides of the rectangle are parallel to the sides of length 3 and length 4.
\item[] \emph{Solution:}  It should be intuitively clear if you draw some diagrams
that the largest area will be attained when two sides of the rectangle actually
lie along sides of the triangle.  Let their lengths be $x,y$, and let the side
of length $x$ lie along the side of length 3 of the triangle, while the side
of length $y$ lies along the side of length 4 of the triangle.  Then we have (by 
similar triangles):  
$$\frac{y}{3 - x} = \frac{4}{3}$$
so $y = \frac{4}{3}(3 - x)$.  The area of the rectangle is 
$$A = xy = \frac{4}{3}x(3 - x) = 4x - \frac{4x^2}{3}.$$
There is one critical point, found by solving
$$0 = A'(x) = 4 - \frac{8x}{3} \Rightarrow x = \frac{12}{8} = \frac{3}{2}.$$
This is a local (and global maximum) since $A''(x) = -\frac{8}{3} < 0$.
The dimensions are $x = \frac{3}{2}$ and 
$$y = \frac{4}{3}\left(3 - \frac{3}{2}\right) = 2.$$
\item All units in a 100-unit apartment building are rented out when the monthly
rent is set at $r = 900$ dollars per month.  Suppose that one unit becomes
vacant with each $10$-dollar increase in the monthly rent and each \emph{occupied} unit
costs $80$ dollars per month in maintenance.  What rent $r$ will maximize the
monthly profit of the building landlord?
\item[] \emph{Solution:}  Let $x$ be the number of $10$-dollar increases in rent
over the $900$ dollar level.  Then the rent is $900 + 10x$ and $100 - x$
units are rented.  The landlord's total income from the rents is
$(900 + 10x)(100 - x)$.  But she also has maintenance expenses from the 
occupied units of $80(100 - x)$.  The profit is
$$P(x) = (900 + 10x)(100 - x) - 80(100 - x) = -10x^2 + 180 x + 82000$$
We have 
$$0 = P'(x) = -20x + 180$$
when $x = 9$.  This gives a local and global maximum for the profit since
$P''(9) = -20 < 0$.  Hence the rent level that maximizes profit
for the landlord is $900 + 9\cdot 10 = 990$ dollars per month.
\item Your job is to design a rectangular industrial warehouse consisting 
of three separate rectangular rooms of equal areas formed by two interior walls
parallel to two of the exterior walls.  The wall materials cost
$500$ dollars per linear meter and the company allocates $2,400,000$ dollars
for the portion of the project consisting of the walls.  What dimensions 
will maximize the area of the warehouse?
\item[] \emph{Solution:}  Let $x$ be length of the sides parallel to the 
two interior walls and let $y$ be the length of the other two sides.  
Then we will need $4x + 2y$ meters of wall material and this costs
$(4x + 2y)(500)$ dollars.  We should certainly use all of the budget
to get the biggest warehouse, so we want
$$(4x + 2y)(500) = 2,400,000.$$
So $y = 2400 - 2x$.  The area is 
$$A = xy = x(2400 - 2x) = 2400x - 2x^2$$
This has critical points where
$$A'(x) = 2400 - 4x = 0$$
or $x = 600$.  This is a local and global maximum for $A$ because
$A''(x) = -4 < 0$ and there is only one critical point.
The dimensions are $x = 600$ and $y = 2400 - 2\cdot 600 = 1200$.   
\item A billboard of height $b$ is mounted on an outside wall of building with 
its bottom at a distance $h$ above eye level as in Figure 30 in our book.
At what distance $x$ from the wall should an observer stand
to make the billboard appear largest?  (That is, we want to maximize the angle
subtended by the billboard at the eye of the observer.)
\item[] \emph{Solution:} Let $x$ be the distance the observer stands from the wall.
From the triangle formed by the eye, the base of the 
wall and the bottom of the billboard, the angle $\alpha$ from the horizontal
to the line from the eye to the bottom of the billboard satisfies
$$\tan(\alpha(x)) = \frac{h}{x}$$
and the angle $\beta$ from the horizontal to the line from the eye to the 
top of the billboard satisfies
$$\tan(\beta(x)) = \frac{b + h}{x}$$
The angle subtended by the billboard at the eye of the observer is 
$$\theta(x) = \beta(x) - \alpha(x) = \tan^{-1}\left(\frac{b + h}{x}\right) - 
\tan^{-1}\left(\frac{h}{x}\right)$$
We want to maximize this as a function of $x$.  The derivative is 
\begin{eqnarray*}
\theta'(x) &=& \frac{1}{1 + \left(\frac{b+h}{x}\right)^2}\cdot \frac{-(b+h)}{x^2} - 
               \frac{1}{1 + \left(\frac{h}{x}\right)^2}\cdot \frac{-h}{x^2}\\
&=& \frac{-(b+h)}{x^2 + (b+h)^2} + \frac{h}{x^2 + h^2}
\end{eqnarray*}
This equals $0$ when 
$$\frac{(b+h)}{x^2 + (b + h)^2} = \frac{h}{x^2 + h^2},$$
or
$$(b+h)(x^2 + h^2) = (x^2 + (b + h)^2)h$$
or
$$bx^2 = (b+h)^2 h - h^2(b+h) = hb(h+b).$$
So 
$$x = \sqrt{h(h+b)}$$
(the negative root can be ignored, since that would represent a symmetrically
placed observer behind the wall).  You can see this is a local and global
maximum for $\theta(x)$ with either the first or the second derivative
test, but I'll omit the details(!)
\end{enumerate}
\end{document}
