Find the point on the line $−x + 2y − 1 = 0$ that is closest to the point $(1, 2)$.
I solved the optimization and got $x=14/10$ and $y = 1.7$ but my $y$ coordinate is not correct. can anyone explain why it's wrong. I used $x$ coordinate and solved for $y$ using $y=(x+1)/2$.
A point on that line is given by $\left(x,y\right)=\left(x,\frac{x+1}{2}\right)$. Using the equation for the distance between two points, the distance between a point on this line and $\left(1,2\right)$ is given by $\sqrt{\left(x-1\right)^{2}+\left(\frac{x+1}{2}-2\right)^{2}}$. You already know this is an optimization problem, so you just need to solve the equation $$\frac{\text{d}}{\text{d}x}\sqrt{\left(x-1\right)^{2}+\left(\frac{x+1}{2}-2\right)^{2}}=0.$$