# Optimization - find point by minimising squared distance

1. Sep 21, 2007

### inner08

Find the point in the plane 3x+2y+z=1 that is the closest to the origin by minimising squared distance. (I hope I translated this ok..)

I was thinking I would need to isolate a variable in the equation for the plane above then substitute it into the distance formula then do a partial derivative.

Something like... D=(x^2+y^2+z^2)^(1/2). Since it is squared I could just have (x^2+y^2+z^2).

z=1-2y-3x

D = x^2+y^2+(1-2y-3x)^2

= x^2+y^2+1-4y-6x+12xy+9x^2
=10x^2+y^2+1-4y-6x+12xy

f_x = 20x-6+12y = 0
y = (6-20x)/12

f_y = 2y-4+12x
y = (4-12x)/2

etc....x=1/4, y=1/2, z=-3/4

It seems ok because it works in the given equation(3x+2y+z=1) but I've never done a problem like this so if its wrong, I do hope I'm atleast on the right track. Hope someone can't let me know.

Thanks,

2. Sep 21, 2007

### mathman

You made an error in your calculation of D. In squaring the expression for z, you omitted 4y^2. Therefore D should have 5y^2 not y^2. You should be able to get the right answer after that. It'll be (3,2,1)/14.