\documentclass{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\usepackage{multicol}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\headheight}{0.0in}
\setlength{\headsep}{0.0in}
\setlength{\topskip}{0.0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7.5in}

\usepackage{color}
\usepackage{hyperref}
\newcommand{\ALPHA}{\checkmark}

\newcommand{\comp}{ \,{\scriptstyle \stackrel{\circ}{}}\, } 
\newcommand{\nullset}{\mathrm{O}\!\!\!\!\big/\,}
\newcommand{\divides}{\,\Big|\,}
\newcommand{\myspace}{\mbox{\parbox[c][0.35in]{0.6in}{\hfill}}}
\newcommand{\varspace}[2]{\mbox{\parbox[c][#1]{#2}{\hfill}}}
\newcommand{\diagquotient}[2]{\displaystyle{{#1 \atop \;}\hspace*{-0.1in} \mbox{\put(0,0){\line(2,1){2}}} \hspace*{0.1in} {\; \atop #2}}}

\newcommand{\force}{{$\mbox{\;}$}}

\begin{document}

%\pagestyle{empty}

\noindent
{\large\bf Name:} \underline{\Large\color{red}\sc\quad Answer Key \quad}
\hfill
{\large \bf Math 1030 Quiz \#5} ({July 30${}^{\mathrm{st}},$ 2013)

\vspace{0.1in}

\hfill {\large You may {\bf skip ONE} of the following problems.} \hfill \hfill

%\vspace{0.1in}

\begin{enumerate}
   \item We have the following supply and demand functions: \qquad $p_s(x) = 20e^{x/10}$ \quad and \quad $p_d(x)= -x^2+500$. 

\vspace{0.1in}
   
             Market equilibrium $(q_E, p_E)=$ \underline{\quad $(19.1025, \  \$135.09)$ \quad}
             
             \vspace{0.05in}
             
             The consumer surplus is \$ \underline{\quad 4,647.08 \quad} \hfill
             The producer surplus is \$ \underline{\quad 1,429.68 \quad}

             \vspace{0.05in}

             I used the following {\sc Alpha} commands...

\vspace{0.05in}

We don't really need to plot our functions, but here's a plot of the supply and demand curves\dots

\verb|plot {20e^(x/10), -x^2+500} where 0<x<30| \href{https://www.wolframalpha.com/input/?i=plot+%7B20e%5E%28x%2F10%29%2C+-x%5E2%2B500%7D+where+0%3Cx%3C30}{\ALPHA}

First, we need to find the market equilibrium. This is where the curves intersect. Setting our functions equal to each other we get\dots

\verb|20e^(x/10) = -x^2+500| \href{https://www.wolframalpha.com/input/?i=20e%5E%28x%2F10%29+%3D+-x%5E2%2B500}{\ALPHA}

Alpha tells us that the curves intersect at $x=19.1025$. We need to plug this into either function (they're equal here) to find the equilibrium price.

\verb|-x^2+500 at x=19.1025| \href{https://www.wolframalpha.com/input/?i=-x%5E2%2B500+at+x%3D19.1025}{\ALPHA}

Alpha tells us that when $q_E = 19.1025$, $p_E = 135.094$.

Now we're ready to compute the consumer and producer surpluses. 

\vspace{-0.1in}

$$ \mbox{Consumer Surplus} = \int_0^{q_E} \mbox{demand}\,dq - q_E \cdot p_E = \int_0^{19.1025} (-q^2+500)\,dq - (19.1025)(135.094)$$

\verb|(int -x^2+500 from 0 to 19.1025) - 19.1025(135.094)| \href{https://www.wolframalpha.com/input/?i=%28int+-x%5E2%2B500+from+0+to+19.1025%29+-+19.1025%28135.094%29}{\ALPHA}

Alpha finds that the consumer surplus is \$4,647.08.

\vspace{-0.1in}

$$\mbox{Producer Surplus} = q_E \cdot p_E - \int_0^{q_E} \mbox{supply}\,dq = (19.1025)(135.094) - \int_0^{19.1025} 20e^{q/10}\,dq$$

\verb|19.1025(135.094) - int 20e^{x/10} from 0 to 19.1025| \href{https://www.wolframalpha.com/input/?i=19.1025%28135.094%29+-+int+20e%5E%7Bx%2F10%7D+from+0+to+19.1025}{\ALPHA}

Alpha finds that the producer surplus is \$1,429.68.

\vspace{0.05in}

   \item Whipple County has determined that their Lorentz curve is given by $\displaystyle L(x) = 0.5x^3+0.4x^2+0.1x$.

             \vspace{0.05in}
            
             The poorest \underline{\quad 54.065\% \quad} percent of the population receives 25\% of the income.

             \vspace{0.05in}

             The poorest 25\% percent of the population receives \underline{\quad 5.781\% \quad} of the income.

             \vspace{0.05in}

             Whipple County's Gini Index is \underline{\quad 0.3833 \quad}.
             
             \vspace{0.05in}
             
             I used the following {\sc Alpha} commands...

             \vspace{0.05in}

As in the previous problem, we don't really need a graph. But I create one anyway. Here we plot the Lorentz curve together with $y=x$ (i.e. total equality).

\verb|plot {0.5x^3+0.4x^2+0.1x, x} on [0,1]| \href{https://www.wolframalpha.com/input/?i=plot+%7B0.5x%5E3%2B0.4x%5E2%2B0.1x%2C+x%7D+on+%5B0%2C1%5D}{\ALPHA}

To find the poorest $x$ percent which receive 25\% of the income requires us to solve the equation $L(x)=0.25$.

\verb|0.5x^3+0.4x^2+0.1x=0.25| \href{https://www.wolframalpha.com/input/?i=0.5x%5E3%2B0.4x%5E2%2B0.1x%3D0.25}{\ALPHA}

Alpha finds that $L(0.540647) = 0.25$. Thus the poorest 54.065\% of the population receive 25\% of the income.

To find how much the poorest 25\% of the population receives, we simply need to compute $L(0.25)$.

\verb|0.5x^3+0.4x^2+0.1x at x=0.25| \href{https://www.wolframalpha.com/input/?i=0.5x%5E3%2B0.4x%5E2%2B0.1x+at+x%3D0.25}{\ALPHA}

Alpha finds that $L(0.25) = 0.0578125$. Thus the poorest 25\% of the population receives 5.781\% of the income.

Finally, recall that the Gini Index is $\displaystyle \dfrac{\mbox{Area between }x\mbox{ and }L(x)}{\mbox{Area under }x} =  \dfrac{(1/2) - \int_0^1 L(x)\,dx}{1/2} = 1-2\int_0^1 L(x)\,dx$.

\verb|1 - 2 int 0.5x^3+0.4x^2+0.1x from 0 to 1| \href{https://www.wolframalpha.com/input/?i=1+-+2+int+0.5x%5E3%2B0.4x%5E2%2B0.1x+from+0+to+1}{\ALPHA}

Alpha finds that the Gini Index is $0.383333$.

             \vspace{0.05in}

\newpage
      
   \item We know that $P'(q) = -4q^3+300q^2-1400q-2000$ for some profit function $P(q)$. In addition, we also know that $q=15$ is a break even quantity for $P(q)$.

             \vspace{0.05in}

             $P(q) =$ \underline{\quad $-q^4+100 q^3-700 q^2-2000 q - 99375$ \quad}

             \vspace{0.05in}

             I used the following {\sc Alpha} commands...

             \vspace{0.05in}

We need to find an antiderivative of $P'(q)$. Thus we need to compute the indefinite integral:\\ $\int P'(q)\,dq = \int (-4q^3+300q^2-1400q-2000)\,dq$.

\verb|int -4q^3+300q^2-1400q-2000| \href{https://www.wolframalpha.com/input/?i=int+-4q%5E3%2B300q%5E2-1400q-2000}{\ALPHA}

Alpha finds that $\int P'(q)\,dq = -q^4+100 q^3-700 q^2-2000 q+C$. Our next task is to figure out what ``$C$'' is. 

We are told that this profit function has a break even quantity at $q=15$. This means that $P(15)=0$. Let's compute $P(15)$ using our newly found formula.

\verb|-q^4+100 q^3-700 q^2-2000 q+C at q=15| \href{https://www.wolframalpha.com/input/?i=-q%5E4%2B100+q%5E3-700+q%5E2-2000+q%2BC+at+q%3D15}{\ALPHA}

Alpha tells us that $P(15)=C+99375$. Since $P(15)=0$, we must have $C+99375=0$ so that $C = -99375$. Therefore, our profit function is $P(q) = -q^4+100 q^3-700 q^2-2000 q - 99375$.

If we punch this into Alpha, it can confirm that $P(q)$ does have a break even point at $q=15$ and that the derivative matches.

\verb|-q^4+100 q^3-700 q^2-2000 q-99375| \href{https://www.wolframalpha.com/input/?i=-q%5E4%2B100+q%5E3-700+q%5E2-2000+q-99375}{\ALPHA}

             \vspace{0.05in}

\end{enumerate}


\end{document}

