online advertising

Sunday, December 6, 2015

UTM Ideals Varieties and Algorithm - Chapter 1 Section 2 Exercise 12

Problem:


Solution:

This problem is adopted from a Calculus textbook.

Find the points on circle $ x^2 + y^2 = 45 $ that are closest and farthest from $ (1, 2) $.

The function to optimize is $ (x - 1)^2 + (y - 2)^2 $. We do not take the square root as optimizing the square is the same as optimizing the square root.

The corresponding Lagrangian is

$ L(x, y, \lambda) = (x - 1)^2 + (y - 2)^2 - \lambda(x^2 + y^2 - 45) $.

The partial derivatives must be 0, therefore, we have

$ \begin{eqnarray*} \frac{\partial L}{\partial x} = 2(x - 1) - 2\lambda x &=& 0 \\ \frac{\partial L}{\partial y} = 2(y - 2) - 2\lambda y &=& 0 \\ x^2 + y^2 &=& 45 \end{eqnarray*} $

The system is not hard to solve manually, but it would be really nice to see this can be solved automatically with Groebner basis.

For the sake of completeness, let's solve this system manually, we see

$ 2(x - 1) - 2\lambda x = 0 \implies x(1-\lambda) = 1 $
$ 2(y - 2) - 2\lambda y = 0 \implies y(1-\lambda) = 2 $

Dividing them, we get $ x = 2y $, this make things very easy now.

$ \begin{eqnarray*} x^2 + y^2 &=& 45 \\ x^2 + (2x)^2 &=& 45 \\ 5x^2 &=& 45 \\ x &=& \pm 3 \\ y &=& \pm 6 \end{eqnarray*} $

No comments:

Post a Comment