\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\usepackage{epsfig}
\begin{document}
\parindent=0pt

\begin{center}
\textbf{Applications of Partial Differentiation}

\textit{\textbf{Extremes within restricted domains}}
\end{center}

\textbf{Question}

In a town, their are 2 competing bakers, so sales for one baker
negatively affects the sales of the other. If baker A produces $x$
loaves of bread per month and baker B produces $y$ loaves of bread per
month, then the profits for A and B respectively are
\begin{eqnarray*}
P & = & 2x-\frac{2x^2+y^2}{10^6}\\
Q & = & 2y-\frac{4y^2+x^2}{2\times 10^6}
\end{eqnarray*}

Find the sum of the profits if the bakers work independently, both
maximizing their profits, assuming the other to do the same.

If the bakers cooperate, find the sum of the profits when each baker
sets their bread production to maximize this sum.


\textbf{Answer}

\begin{eqnarray*}
P & = & 2x-\frac{2x^2+y^2}{10^6}\\
Q & = & 2y-\frac{4y^2+x^2}{2\times 10^6}
\end{eqnarray*}

If each baker tries to maximize their own profits
\begin{eqnarray*}
0 = \frac{\partial P}{\partial x} & = & 2 - \frac{4x}{10^6}\\
\Rightarrow x & = & 5 \times 10^5\\
& & \\
0 = \frac{\partial Q}{\partial y} & = & 2 - \frac{8y}{2\times 10^6}\\
\Rightarrow y & = & 5 \times 10^5\\
\textrm{and so} & & \\
P + Q & = & 10^6 - \frac{3 \times 25 \times 10^{10}}{10^6}\\
& & + 10^6 - \frac{5 \times 25 \times 10^{10}}{2 \times 10^6}\\
& = & \pounds 625,000
\end{eqnarray*}

If the bakers cooperate to maximize total profit
\begin{eqnarray*}
T & = & P + Q\\
& = & 2x + 2y - \frac{5x^2+6y^2}{2 \times 10^6}
\end{eqnarray*}
Maximize profit by making $x$ and $y$ satisfy
\begin{eqnarray*}
0 = \frac{\partial T}{\partial x} & = & 2 - \frac{10x}{2 \times
10^6}\\
0 = \frac{\partial T}{\partial y} & = & 2 - \frac{12y}{2 \times
10^6}\\
\Rightarrow x & = & 4 \times 10^5\\
y & = & \frac{1}{3} \times 10^6
\end{eqnarray*}
This gives
$$T=8 \times 10^5 + \frac{2}{3}\times 10^6 - \frac{80 \times 10^{10} +
\frac{2}{3} \times 10^{12}}{2 \times 10^6}$$
$$\Rightarrow T \approx \pounds733,333$$

\end{document}

