Drawing a graph of a function. $h_{1}=pq-\frac{1}{2}kq^{2},\ h_{2}=pq-kq^{2}, \frac{dh_{2}}{dh_{1}}=\frac{p-2kq}{p-kq}$, $k,p$ are constant. My question are how can I draw a graph of function $h_{2}$ measuring $h_{1}$ on the horizontal axis and $h_{2}$ on the vertical axis, and where does this function reach the maximum?
I have no idea about it, I never met this kind of questions before, anyone could help me? Thanks.
 A: Solve $h_1$ for $q$ in $h_1=h_1(q)$, resulting in $q=q(h_1)$ and then replace $q$ in $h_2(q)$ with that $q(h_1)$.
The maximum might be reached on the ends of the definition interval (need to check what that is here), or as relative maximum within where it needs 
$$
h_2'(h_1) = 0 \quad h_2''(h_1) < 0
$$
So
$$
h_1 = pq - \frac{k}{2} q^2 \Rightarrow \\
q^2 = \frac{2p}{k}q - \frac{2}{k} h_1 \quad (*)
$$
This gives
$$
\left(q - \frac{p}{k}\right)^2 = \frac{p^2}{k^2} - \frac{2}{k} h_1 \Rightarrow \\
q = \frac{p \pm \sqrt{p^2 - 2 k h_1}}{k}
$$
and leads to 
\begin{align}
h_2 
&= pq - k q^2 \\
&= pq - 2pq + 2 h_1 \\
&= 2 h_1 - p q \\
&= 2 h_1 - p \frac{p \pm \sqrt{p^2 - 2 k h_1}}{k}
\end{align}
if I made no error. :-)
Now an image for the case $p = k = 1$:

The interesting bit is that the maximum of $h_2(q)$ has the same value as the maximum of $h_2(h_1)$. Just not at $q^*$ but at $h_1(q) = h_1^* = q^*$ or $h_1 = q(h_1^*) = q(q^*)$.
The resulting $h_1(h_2)$ is multivalued, except for $h_1 = 0.5$, thus a relation and not a function.
