\documentclass[10pt,a4paper,addpoints]{exam}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{arrows}
\pagestyle{head}
\usepackage{hyperref}
\usepackage{color}
%\headrule
%\header{MATH 11}{Exam 1}{Fall 2016}
\begin{document}
\begin{coverpages}
\begin{center}\huge MATH 1112 - EXAM 1 - FALL 2016\\
\huge SOLUTION \\
\end{center}
\begin{flushleft}\vspace{0.5in}
Friday 9 September 2016\\
Instructor: Tom Cuchta
\end{flushleft}
\textbf{Instructions:}
\begin{itemize}
	\item  Show all work, clearly and in order, if you want to get full
	credit. If you claim something is true \textbf{you must show work backing up your claim}. I reserve the right to take off points if I cannot see how you arrived at your answer (even if your final answer is correct).
	\item Justify your answers algebraically whenever possible to ensure full credit. 	
	\item  Circle or otherwise indicate your final answers.
	\item  Please keep your written answers brief; be clear and to the point.
	\item  Good luck!
\end{itemize}
\vspace*{10pt}
\end{coverpages}

\begin{questions}
	\question[15] For the points $P=(-1,2)$ and $Q=(4,6)$:
		\begin{parts}
			\part[3] Find the distance between $P$ and $Q$. \\
			\textit{Solution:} The distance formula (pg. 8 in the book) for the distance between a point $P=(x_1,y_1)$ and a point $Q=(x_2,y_2)$ is given by
			$$d(P,Q) = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}.$$
			For our particular $P$ and $Q$ this {\color{blue} \href{http://www.wolframalpha.com/input/?i=distance+from+(-1,2)+to+(4,6)}{yields}}
			$$d(P,Q)=\sqrt{(-1-4)^2 + (2-6)^2}=\sqrt{(-5)^2 + (-4)^2} = \sqrt{25+16} = \sqrt{41}.$$
			\part[3] Find the midpoint between $P$ and $Q$. \\
			\textit{Solution:} The midpoint (pg. 10) between the point $P=(x_1,y_1)$ and the point $Q=(x_2,y_2)$ is the point
			$$\mathrm{midpoint}(P,Q)=\left( \dfrac{x_1+x_2}{2}, \dfrac{y_1+y_2}{2} \right).$$
			For our particular $P$ and $Q$, this {\color{blue} \href{http://www.wolframalpha.com/input/?i=midpoint+between+(-1,2)+and+(4,6)}{yields}}
			$$\mathrm{midpoint}(P,Q) = \left( \dfrac{-1+4}{2}, \dfrac{2+6}{2} \right) = \left( \dfrac{3}{2}, \dfrac{8}{2} \right) = \left( \dfrac{3}{2}, 4 \right).$$
			\part[3] Find an equation of the line containing the points $P$ and $Q$. \\
			\textit{Solution:} We find the slope of this line by
			$$m=\dfrac{6-2}{4-(-1)} = \dfrac{4}{5}.$$
			Now we use the point-slope form of the equation of the line (pg. 51) with the point $Q=(4,6)$ (it's ok to use $P$ here as well) to get
			$$y-6=\dfrac{4}{5}(x-4).$$
			If you had used $P$ you would have gotten
			$$y-2=\dfrac{4}{5}(x-(-1)),$$
			which is an equivalent equation. Indeed, both of these are also {\color{blue} \href{http://www.wolframalpha.com/input/?i=equation+of+line+containing+(-1,2)+and+(4,6)}{equivalent}} to the ``slope-intercept" form
			$$y=\dfrac{4}{5}x + \dfrac{14}{5},$$
			which is a third equivalent way to write the equation.
			\part[6] Give the slope and the $y$-intercept of the line you found in part (c). \\
			\textit{Solution:} We saw above that the slope-intercept form of the equation of the line (pg. 41) in part (c) is
			$$y=\dfrac{4}{5}x + \dfrac{14}{5}.$$
			In other words, the slope is $\dfrac{4}{5}$ and the $y$-intercept is $\left( 0 ,\dfrac{14}{5} \right).$
		\end{parts}
	\newpage
	
	\question[10] Write an equation for the circle with center $(-5,3)$ and radius $2$ \textbf{and} draw this circle in the provided grid.
	
\begin{minipage}{0.45\textwidth}
	\begin{tikzpicture}
		\draw[very thin, step=0.5, gray] (0,0) grid (6,6);
		\draw[thick, <->] (5,0) -- (5, 6);
		\draw[thick, <->] (0,1) -- (6,1);
		\draw[thick] (3.5,3.5) circle (1);
		\foreach \x in {0.5,1.5,...,4.5}
			\pgfmathsetmacro\result{2*\x-10}
			\draw[very thick] (\x,0.9) -- (\x, 1.1)
				node [below, yshift=-1ex] {\pgfmathprintnumber{\result}};
		\foreach \y in {1.5, ..., 5.5}
			\pgfmathsetmacro\result{2*\y-2}
			\draw[very thick] (4.9,\y) -- (5.1,\y)
				node[right] {\pgfmathprintnumber{\result}};
	\end{tikzpicture}
\end{minipage}
\begin{minipage}{0.45\textwidth}
The equation of a circle with center $(h,k)$ and radius $r$ is (pg. 11) 
$$(x-h)^2 + (y-k)^2 = r^2.$$
We are told $(h,k)=(-5,3)$ and $r=2$, so our circle has equation
$$(x-(-5))^2 + (y-3)^2 = 2^2,$$
or, simplified, 
$$(x+5)^2 + (y-3)^2 = 4.$$

\end{minipage}	
	\question[10] Find an equation of the following lines:
		\begin{parts}
			\part[5] the line passing through the point $(3,-2)$ and parallel to $3x+4y=5$. \\
			\textit{Solution:} Such a line must have the same slope as $3x+4y=5$ and also pass through $(3,-2)$. The fastest way (but not only) to find the slope of $3x+4y=5$ is to write it in slope-intercept form, i.e. solve for $y$. Do this by first subtracting $3x$ to get
			$$4y = -3x + 5,$$
			and then dividing by $4$ to get
			$$y = -\dfrac{3}{4}x + \dfrac{5}{4}.$$ \\
			From this formula, we can read off the slope of the line $3x+4y=5$ as $m=-\dfrac{3}{4}$. We want to find an equation for the line with slope $m=-\dfrac{3}{4}$ passing through the point $(3,-2)$. We use the point-slope form of the line to get
			$$y-(-2) = -\dfrac{3}{4} (x-3),$$
			or
			$$y+2 = -\dfrac{3}{4} (x-3).$$
			Which we could also write in the slope intercept form by subtracting $2$ and distributing $-\dfrac{3}{4}$ to get
			$$y=-\dfrac{3}{4}x + \dfrac{9}{4} - 2 = -\dfrac{3}{4}x + \dfrac{9}{4} - \dfrac{8}{4}=-\dfrac{3}{4}x + \dfrac{1}{4}.$$
			\part[5] the line passing through the point $(3,-2)$ and perpendicular to $3x+4y=5$. \\
			\textit{Solution:} The line perpendicular to $3x+4y=5$ has negative reciprocal slope of it. Since the slope of $3x+4y=5$ is $-\dfrac{3}{4}$ as discussed above, the line perpendicular to $3x+4y=5$ must have slope $m=\dfrac{4}{3}$. Using the point-slope form of the equation of a line, the line with slope $\dfrac{4}{3}$ passing through $(3,-2)$ is
			$$y-(-2) = \dfrac{4}{3}(x-3),$$
			or
			$$y+2 = \dfrac{4}{3}(x-3).$$
		\end{parts}
	\newpage
	
	\question[10] Find all intercepts and then graph the equation. If an intercept does not exist, state so:
			$$2x-4y=8.$$
			\begin{tikzpicture}
				\draw[very thin, gray,step=1] (-5,-5) grid (5,5);
				\draw[very thick, <->] (-5,0) -- (5,0);
				\draw[very thick,<->] (0,-5) -- (0,5);
				\draw[thick,fill=black] (4,0) circle (0.3em);
				\draw[thick,fill=black] (0,-2) circle (0.3em);
				\draw[thick,<->] (-5,-4.5) -- (5,0.5);
			\end{tikzpicture} \\
			\textit{Solution:} To find the $x$-intercept, set $y=0$ in the equation to get
			$$2x=8,$$
			and solve it to get $x=4$. Therefore the $x$-intercept is $(4,0)$. To find the $y$-intercept, set $x=0$ in the equation to get
			$$-4y=8,$$
			and solve it to get $y=-2$. Therefore the $y$-intercept is $(0,-2)$. To plot, we place the intercepts on the graph and then draw the line connecting them.
			\vspace*{2cm}
			
			\hfill $x$-intercept(s): $(4,0)$
			\hfill $y$-intercept(s): $(0,-2)$ \\
			
	\question[10] What is the domain of the function $g(x) = \dfrac{5x}{(x+1)(x-5)}$? \\
\textit{Solution:} The domain of $g$ is all real numbers except where the denominator is zero. The denominator is zero whenever $x+1=0$, i.e. $x=-1$ or $x-5=0$, i.e. $x=5$. Therefore the domain of $g$ is ``all real numbers except for $-1$ or $5$" or an equivalent expression.	
\newpage
	\question[10] State the domain and range of the function with the following graph. \\
	
	\begin{tikzpicture}[scale=1.2]
		\draw[very thin, gray, step=0.5] (-2,-2) grid (2,2);
		\draw[very thick, <->] (0,-2) -- (0,2);
		\draw[very thick,<->] (-2,0) -- (2,0);
		\draw[very thick] (-1,-1.5) -- (-0.5,-0.5) -- (0.75
		,-0.5) -- (1.5,1);
		\draw[fill=black] (-1,-1.5) circle (0.075);
		\draw[fill=white] (1.5,1) circle (0.075);
		\foreach \x in {-1.5, -1, ..., 1.5}
			\draw[very thick] (\x,-0.1) -- (\x,0.1);
		\foreach \y in {-1.5, -1, ..., 1.5}
			\draw[very thick] (-0.1,\y) -- (0.1,\y);
		\draw node at (0.2,0.35) {$1$};
		\draw node at (0.2,0.85) {$2$};
		\draw node at (0.15,-0.2) {$0$};
		\draw node at (0.2,-0.65) {$-1$};
		\draw node at (0.2,-1.15) {$-2$};
		\draw node at (0.2,-1.65) {$-3$};
		\draw node at (-0.5,-0.2) {$-1$};
		\draw node at (-1.04,-0.2) {$-2$};
		\draw node at (0.6,-0.2) {$1$};
		\draw node at (1.1,-0.2) {$2$};
		\draw node at (1.6,-0.2) {$3$};
	\end{tikzpicture}\\
	
	\hfill Domain: $[-2,3)$
	\hfill Range: $[-3,2)$ \hfill
	
	\question[15] Solve the following \textbf{and} graph the solution.
	\begin{parts}
		\part[5] $2x+1<3$ \\
		\textit{Solution:} Solve this inequality by first subtracting $1$ to get
		$$2x < 2,$$
		and then dividing by $2$ to get
		$$x < 1.$$
		The graph is \\[10mm]
		\begin{tikzpicture}[scale=20]
			\draw[<->, thick] (-0.2,0) -- (0.2,0);
			\draw (0,-0.02) node[below] {$1$};
			\draw[<-), ultra thick, blue] (-0.2,0) -- (0,0);
		\end{tikzpicture}
		
		\part[5] $-2x-2 \geq 6$ \\
		\textit{Solution:} First add $2$ to get
		$$-2x \geq 8.$$
		Divide both sides by $-2$ (recall to flip the inequality) to get
		$$x \leq -4.$$
		The graph is \\[10mm]
		\begin{tikzpicture}[scale=20]
			\draw[<->, thick] (-0.2,0) -- (0.2,0);
			\draw (0,-0.02) node[below] {$-4$};
			\draw[{<-]}, ultra thick, blue] (-0.2,0) -- (0,0);
		\end{tikzpicture}
		
		\part[5] $3x-1<-5$ or $3x-1 > 5$ \\
		\textit{Solution:} Solve the first inequality to get $x < -\dfrac{4}{3}$ and solve the second to get $x > \dfrac{6}{3}=2$. To graph the inequality we plot both of these on the same line: \\[10mm]
		\begin{tikzpicture}[scale=20]
			\draw[<->, thick] (-0.2,0) -- (0.2,0);
			\draw (-0.11,-0.01) node[below] {$-\dfrac{4}{3}$};
			\draw (0.02,-0.01) node[below] {$2$};
			\draw[{<-)}, ultra thick, blue] (-0.2,0) -- (-0.1,0);
			\draw[(->,ultra thick,blue] (0.02,0)--(0.2,0);
		\end{tikzpicture}
	\end{parts}
	\newpage
	
	\question[10] Recall that the interest $I$ on a principal $P$ invested at an interest rate $r$ for $t$ years is $I=Prt$. How much principal would you have to invest at a $10\%$ interest rate for $2$ years if you want to make $\$100$ in interest? \\
	\textit{Solution:} We are told $I=\$50$, $r=10\%=\dfrac{10}{100}=\dfrac{1}{10}$, and $t=2$ years. Plugging this information into the equation $I=Prt$ yields
	$$100=P \dfrac{2}{10},$$
	or
	$$100 = \dfrac{P}{5}.$$
	Solving this for $P$ yields
	$$P=\$500.$$
	\question[10] In a triangle, the top angle is three times as large as the left angle which has measure $x$. The right angle is $10^{\circ}$ more than angle $x$. Find the measures of the three angles. (Hint: the sum of the angles in a triangle add to $180^{\circ}$.) \\
\begin{center}\begin{tikzpicture}[scale=2]
\draw (-1,0) -- (1,0) -- (0,1) -- (-1,0);
\draw node at (0,0.8) {$3x$};
\draw node at (-0.7,0.1) {$x$};
\draw node at (0.5,0.1) {$x+10$};
\end{tikzpicture}\end{center} 
\textit{Solution:} The sum of the angles of the triangle are $180$ and so
$$3x + x + (x+10)=180.$$
Simplifying the left hand side yields
$$5x+10=180.$$
Subtract $10$ to get
$$5x=170.$$
Now divide by $5$ to {\color{blue} \href{http://www.wolframalpha.com/input/?i=solve+3x%2Bx%2B(x%2B10)%3D180}{get}}
$$x = \dfrac{170}{5} = 34.$$
The other two angles are $34+10=44$ and $3 \cdot 34 = 102$. 
\end{questions}
\end{document}