\documentclass{article}
\usepackage{amsthm,amsfonts}
\textwidth=6.25in
\textheight=9.5in
\headheight=0in
\headsep=.5in
\hoffset  -1in
\topmargin -.75in

\begin{document}
\begin{flushright}
Scott Williams\\
Math 122B\\
8-26-13\\
\end{flushright}

\begin{center}
\Large\textbf{Homework 1}
\end{center}

\begin{enumerate}
\item Suppose $x$ and $y$ are positive integers such that the sum of $x^2$ and $y$ is $10x$. Find the values of $x$ and $y$ which maximize the square-root of the sum of $2x$ and $y$.\\

\emph{Solution. } We want to find $x$ and $y$ that maximizes
\[A=\sqrt{2x+y}.\]
We are given that $x^2+y=10x$, so it follows
\[y=10x-x^2.\]
Since we know both $x$ and $y$ are positive integers and $y=x(10-x)$, it must be the case that $0<x<10$ (or equivalently, $1\leq x\leq 9$, since $x$ is an integer). 

Substituting the above equation for $y$ into $A$ and simplifying we see
\begin{eqnarray*}
A&=&\sqrt{2x+y}\\
&=&\sqrt{2x+(10x-x^2)}\\
&=&\sqrt{12x-x^2}\\
&=&\left(12x-x^2\right)^{1/2}.
\end{eqnarray*}

We now want to determine the critical points of $A$, so we first find $A'$:
\begin{eqnarray*}
A'&=&\frac{1}{2}\left(12x-x^2\right)^{-1/2}\left(12-2x\right)\\
&=&\frac{12-2x}{2\sqrt{12x-x^2}}\\
&=&\frac{6-x}{\sqrt{x(12-x)}}.
\end{eqnarray*}
Clearly $A'=0$ when $x=6$ so this is the critical point. (Note: We do not need to consider the values for which the derivative is undefined since these $x$-values are all outside the domain of $x$!)

Evaluating $A$ at our critical point and endpoints we see:
\begin{itemize}
\item $x=1 \Longrightarrow A=\left(12(1)-(1)^2\right)^{1/2}=\sqrt{11}\approx 3.317$
\item $x=6 \Longrightarrow A=\left(12(6)-(6)^2\right)^{1/2}=\sqrt{36}=6$
\item $x=9 \Longrightarrow A=\left(12(9)-(9)^2\right)^{1/2}=\sqrt{27}\approx 5.196$
\end{itemize}
Thus, $x=6$ is a global maximum and so $x=6$ and $y=10(6)-(6)^2=24$ are the desired integers.
\end{enumerate}
\end{document}
