\documentclass[11pt]{article}
%Options: draft shows overfull lines, reqno-leqno puts eq numbers on right/left
%\documentclass[11pt,draft, reqno,a4paper,psamsfonts]{amsart}

\usepackage{amsmath}		% preloaded by amsart above
\usepackage{amssymb}
%\usepackage{eufrak}		% preloaded by amsart(?) above
%\usepackage[mathscr]{eucal}
\newcommand\eurfamily{\usefont{U}{eur}{m}{n}}	% Fancy script font
\DeclareTextFontCommand{\texteur}{\eurfamily}
\usepackage{amscd}		% for commutative diagrams
%\usepackage{pslatex}
%\usepackage[dvips]{epsfig}	% to include PostScript figures
\usepackage{graphicx}           % replaces epsfig
\usepackage{amscd}      % for commutative diagrams
%\usepackage[dvips]{epsfig}	% to include PostScript figures
\newcommand{\comments}[1]{}     % to insert a comment
\usepackage{verbatim}
\usepackage{hyperref}
%\usepackage[active]{srcltx}     % This must be the LAST package

% 			*** CHANGE DIMENSIONS ***
\voffset=-0.3truein		% LaTeX has too much space at page top
% \advance\hoffset by .375 in
% \advance\voffset by .125 in
\addtolength{\textheight}{0.3truein}
\addtolength{\textheight}{\topmargin}
\addtolength{\topmargin}{-\topmargin}
%\showthe\textheight
\textwidth  6.0in		% LaTeX article default 360pt=4.98''
\oddsidemargin 0pt	% \oddsidemargin  .35in   % default is 21.0 pt
\evensidemargin 0pt	% \evensidemargin .35in   % default is 59.0 pt
\mathsurround 1pt
%\parindent=20pt

% 		*** SWITCH BACK TO PLAIN.TeX USAGE ***
\renewcommand\smallskip{\vskip\smallskipamount}
\renewcommand\medskip{\vskip\medskipamount}
\renewcommand\bigskip{\vskip\bigskipamount}

% 			*** ENVIRONMENT ***
%\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{cor}[theorem]{Corollary}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{prop}[theorem]{Proposition}
%\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{defn}[theorem]{Definition}
%\newcommand{\Proof}{\noindent{\sc Proof:} }
\newcounter{bean}
\newcounter{bacon}
\newcounter{butter}

% 			*** FONT STUFF ***
% Font Commands (and examples):			 Example
\newcommand{\trm}{\textrm}% text roman		\trm{Rush}
\newcommand{\tbf}{\textbf}% text bold		\tbf{Rush}
\newcommand{\tit}{\textit}% text italic		\tit{Rush}
\newcommand{\tsl}{\textsl}% text slanted	  etc.
\newcommand{\ttt}{\texttt}% text typewriter
\newcommand{\tsc}{\textsc}% text small caps
\newcommand{\tsf}{\textsf}% text sans serif
\newcommand{\tup}{\textup}% text upright

\newcommand{\mrm}{\mathrm}% math roman
\newcommand{\mbf}{\mathbf}% math bold
\renewcommand{\mit}{\mathit}% math italic	% undefined by amsart
%\newcommand{\mit}{\mathit}% math italic
\newcommand{\msf}{\mathsf}% math sans serif
\newcommand{\mtt}{\mathtt}% math typewriter

\newcommand{\Cal}{\mathcal}			% Calligraphic - caps only
\newcommand{\BB}{\mathbb}			% Blackboard Bold - caps only
% the old \frak is obsolete so reuse its name
\renewcommand{\frak}{\mathfrak}			% Math Fraktur (= Gothic;
\newcommand{\BM}{\boldsymbol}			% Bold math symbol Ital
\DeclareMathAlphabet{\BMi}{OT1}{cmm}{b}{it}	% Bold math italic
\newcommand{\fancy}{\texteur}			% Fancy script

%   Examples: (assumed enclosed by $  $ )
%	\Cal{A}		Calligraphic  A
%	\BB{C}		Blackbord Bold  C
%	\frak{g}		Fraktur (= Gothic) g
%	\BM{\alpha}	bold Greek alpha
%	\BM{\Cal{A}}	bold Calligraphic  A
%	\fancy{\Large Nice}	Large size fancy:  Nice	      ($  $ not needed)
%	\BM{R}		bold math italic R
%	{\mathversion{bold} u'' = f(x)}	  prints formula bold

% 			*** MACROS ***
%MATH Macros
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\F}{\mathbb{F}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\abs}[1]{\lvert #1 \rvert}		% absolute value
\newcommand{\norm}[1]{\lVert #1 \rVert}		% norm
\newcommand{\ip}[2]{\langle #1,\, #2\rangle}	% ip = inner product
\newcommand{\ipdot}[2]{ #1\cdot #2}	% ipdot = dot product
\newcommand{\im}{\text{im}}
\renewcommand{\ker}{\text{ker}}
\newcommand{\brak}[2]{[#1,\, #2]}		% brak = bracket
\newcommand{\brac}[1]{\{\,#1\,\}}		% brac = brace  {  }
\newcommand{\vect}[1]{\mathbf{#1}}		% for bold face vectors
\newcommand{\vb}{\vec{b}}
\newcommand{\ve}{\vec{e}}
\newcommand{\vu}{\vec{u}}
\newcommand{\vv}{\vec{v}}
\newcommand{\vw}{\vec{w}}
\newcommand{\vx}{\vec{x}}
\newcommand{\vy}{\vec{y}}
\newcommand{\vz}{\vec{z}}
%\newcommand{\Vec}[1]{\vec{#1}}
\newcommand{\bpmat}{\begin{pmatrix}}
\newcommand{\epmat}{\end{pmatrix}}
\newcommand{\bigstrut}{\rule[-5pt]{0pt}{25pt}}
\newcounter{numb}
\newcommand{\Numb}{\stepcounter{numb}\arabic{numb}}
\newcommand{\Numbb}{{\arabic{numb}}{\usecounter{numb}}}

%The following environment is for sets of problems.
\newenvironment{problems}{\begin{list}{\arabic{numb}.}{\usecounter{numb}
\setlength{\leftmargin}{20pt}
\setlength{\labelwidth}{15pt}
\setlength{\labelsep}{5pt}
\setlength{\itemsep}{ 15.0pt plus 2.5pt minus 1.0pt}
}
}
{\end{list}}

%The next environment is for the parts a), b), ... of a problem.
 \newenvironment{parts}{\begin{list}{\alph{bean}) }{\usecounter{bean}
\setlength{\leftmargin}{20pt}
\setlength{\labelwidth}{15pt}
\setlength{\labelsep}{5pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
}
}
{\end{list}}

%==================== END PREAMBLE ============================
\begin{document}
% Begin body of article here.
\vspace*{-1.5cm}
%\pagestyle{empty}
\parindent=0pt
{\large Math 210, Spring 2019 \hfill Jerry L. Kazdan}
\medskip
\begin{center}
{\large\bf Distance From a Point To a Line}
\end{center}

\begin{problems}

\item Find the distance from the point $P=(2,3)$ to the straight line
  $\Cal{L}:=\{(x,y)\in\R^2\,:\, x+2y=0\}$.
\smallskip

{\sc Solution: }Method 1. Let $Q=(x,y)$ be a point on the line and
$U=(1,2)$.  Then the equation of the line means that  $\ip{Q}{U}=0$ so the vector $U$ is orthogonal to the points on the line.  
$$
\Cal{L}=\{Q\in\R^2\,:\,\ip{Q}{U}=0\}.
$$ 
To find the distance from $P$ to $\Cal{L}$ we find the orthogonal
projection of $P$ onto a {\it unit vector} $\hat U$, in the direction
of $U$, so $\hat{U}=U/\sqrt 5$.
$$
P=c\hat{U} +W,\qquad\text{where}\qquad W\perp \hat{U}.
$$
Taking the inner product of both sides with $\hat  U$ we find
$$
\ip{P}{\hat U}=c\ip{\hat U}{\hat U}, \qquad\text{so}\qquad
c=\frac{\ip{P}{\hat U}}{\norm{\hat U}^2} =\frac{8}{\sqrt5}.
$$
The desired projection is distance is $\abs{c}=8/\sqrt 5$.
Note $W=P-c\hat U=\frac{1}{5}(2,-1)$
\medskip

Method 2 (calculus). We think of the points on line as the path of a particle at time $t$. Let $V=(2,-1)$ (think of $V$ as a velocity
vector).  Then
$$
\Cal{L}=\{Q\in\R^2\,:\, Q(t)=tV \text{ for some }t\in\R.
$$ 
We want to  $t_0$ to minimize $h(t):=\norm{P-Q(t)}^2$, so
$$
0=h'(t)=2\ip{P-Q(t)}{-Q'(t)}=2\ip{P-tV}{-V}
$$
which gives $t_0=\ip{P}{V}/\norm{V}^2 = 1/5$ and $t_0V=\frac{1}{5}(2,-1$ is the point on the line that is closest to $P$.  This is the same as the point $W$ found above.  Also $P-t_0V=\frac{8}{5}(1,2)=c\hat U$ found above.  In particular, the distance from $P$ to the line is
$$
\norm{P-t_0V}=8/\sqrt5.
$$




\end{problems}
\end{document}
