find a point on ellipse closest to origin Find the points on the ellipse $2x^2 + 4xy + 5y^2 = 30$ closest and farthest from origin. How to do this problem? I know how to find a closest point if $z = f(x,y)$ is given, however, this is 2 dimensional.
 A: If Lagrange multipliers are not yet part of the toolkit, or even if they are, we can use a perpendicularity argument. 
Visualize circles $x^2+y^2=r^2$, where $r$ is a variable that starts very close to $0$, and increases.
There is a *smallest*value of $r$ such that $x^2+y^2=r^2$ meets our ellipse, and a biggest. These are what we are looking for.  At these values of $r$, the circle $x^2+y^2=r^2$ is tangent to our ellipse. 
Let the point of tangency be $P=(a,b)$. Then
$$2a^2+4ab+5b^2=30.\tag{$1$}$$
The line $OP$ is perpendicular to the tangent at $(a,b)$ of the circle, and hence of the ellipse.
Now we can use either one variable calculus (implicit differentiation) or partial derivatives. If $f(x,y)=2x^2+4xy+5y^2-30$, we have $f_x(x,y)=4x+4y$ and $f_y(x,y)=4x+10y$. 
The perpendicularity condition is that the dot product of $(4a+4b, 4a+10b)$ and $(a,b)$ is $0$. So we get
$$a(4a+4b)+b(4a+10b)=4a^2+14ab+4b^2=0.\tag{$2$}$$
Solve, using the Qadratic Formula. We get
$$a=\left(\frac{-7\pm\sqrt{33}}{4}\right)b.$$
Now substitution in Equation $(1)$gives our candidates.
A: You can use Lagrange multipliers, too, since you have to find the minimum/maximum of the function $f(x,y)=x^2+y^2$ with the constraint $2x^2+4xy+5y^2-30=0$. We get:
$$\frac{2x+4y}{x}=\frac{4x+5y}{y},$$
that is equivalent to:
$$\frac{y}{x}-\frac{x}{y}=\frac{3}{4},$$
so, in order to find the closest/farthest point from the origin, you simply have to intersect the ellipse with the two lines $y=mx$ for
$$ m = \frac{y}{x} = \frac{3\pm\sqrt{73}}{8}. $$
A: Hint: Use Lagrange multipliers!
A: Another way is use Rotation of axes, to eliminate the $xy$ term.
Here $\cot 2\theta=\frac{2-5}4=-\frac 3 4$
$\frac {\cos 2\theta}3=\frac{\sin 2\theta}{-4}=\frac 1{\pm 5}$ (Using squaring & adding)
If $\cos 2\theta=\frac 3 5,\sin 2\theta=-\frac 4 5$
Using $\cos 2\theta=2\cos^2\theta-1=1-2\sin^2\theta$, we get $\sin^2\theta=\frac 1 5$ and $\cos^2\theta=\frac 4 5\implies \cos\theta=\pm\frac 2{\sqrt 5},\sin\theta=∓\frac 1{\sqrt 5}$ as $\sin 2\theta<0$, the sign of $\cos\theta,\sin\theta$ will be opposite.
The equation of the ellipse in the rotated axes becomes, $$\frac{x'^2}{30}+\frac{y'^2}{5}=1$$
Now in orthogonal transformation, the distance between two points is one of the invariants and in rotation, the origin remains unchanged and any point of this curve can be P$(\sqrt{30}\cos \phi,\sqrt5 \sin \phi)$.
The distance of P from the origin is $\sqrt{30\cos^2\phi+5 \sin^2 \phi}$
$=\sqrt{30-25\sin^2 \phi}$ 
The distance will be minimum $(=\sqrt 5)$ if $\sin^2 \phi=1$ i.e., from $(0,\pm\sqrt 5)$ in the rotated co-ordinates.
The distance will be maximum $(=\sqrt {30})$ if $\sin^2 \phi=0$ i.e., from $(\pm\sqrt {30},0)$ in the rotated co-ordinates.
Now use $x=x'\cos\theta-y'\sin\theta$ and $y=x'\sin\theta+y'\cos\theta$.
We have already derived, $\cos\theta=\pm\frac 2{\sqrt 5},\sin\theta=∓\frac 1{\sqrt 5}$ 
For the minimum distance, if $\cos\theta=\frac 2{\sqrt 5},\sin\theta=-\frac 1{\sqrt 5}$ 
If $y'=\sqrt 5,x=-\sqrt 5(-\frac 1{\sqrt 5})=1$ and $y=\sqrt5(\frac 2{\sqrt 5})=2$
Similarly, if $y'=-\sqrt 5, (x,y)$ will be $(-1,-2)$
The maximum case can be handled in the same way.
A: Are cylindrical coordinates allowed? 
Let $x=rcos\theta$ and $y=rsin\theta$.
$2x^2+4xy+5y^2=30$ becomes, $2r^2cos^2\theta+4r^2sin\theta cos\theta+5r^2sin^2\theta$=30
We can treat r as an implicit function of $\theta$ and find the maximum and minimum values by setting $r'$ to $0$. 
Keeping in mind $sin^2\theta+cos^2\theta=1$, the expression can be rewritten as $r^2(2+4sin\theta cos\theta+3sin^2\theta)=30$.
Take the derivative with respect to theta on both sides. 
By the product rule we can first differentiate  $r^2$ and multiply by the $\theta$ term in parentheses being left alone. To that, we add the product of $r^2$ left alone with the $\theta$ derivative of the expression in parentheses. 
Since we are finding an extremum, we are assuming $r'$ is 0, so we only actually need to take the derivative of the term in parentheses. The derivative of the right side of the equation is $0$. 
Differentiating we have $r^2(4cos2\theta +3sin2\theta)=0$.
Cancel $r^2$ and divide by $cos2\theta$, then rearranging terms we find that, 
$tan2\theta$=-4/3.
