Mathematics max and min $x$ and $y$ values of an ellipse I am trying to find the max and min x and y values of an ellipse. The ellipse is given by $$x^2-xy+y^2=3$$
So I need to find the max points, so I need the derivative of the function.
I got $$\dfrac{dy}{dx} = \dfrac{(y-2x)}{(2y-x)}$$
So I then thought that I should get the x value and the y value so I got $x=-(y/2)$ and $y=-2x$
But now I'm not sure what to do?
 A: First determine when $\dfrac {dy}{dx} = 0$, in terms of $x$ and in terms of $y$. In terms of $y$, this is when $y = 2x$, and in terms of $x$, this is when $x = \frac y2$. (You simply have sign-errors in your conclusions).
Next, substitute $y = 2x$ into the equation of the ellipse, and solve the resulting quadratic equation to find it's zeros. Then determine which, if either, gives a maximum, which is a minimum.
$$x^2-xy+y^2=3 \iff x^2 - x(2x) + (2x)^2 - 3 = 0$$ $$ \iff 3x^2 - 3 = 3(x^2 - 1)= 0$$
$$x = \pm  1 $$
Now, find the corresponding $y$ values, using the equation of the parabola $$x = 1 \implies y^2 - y - 2 = (y - 2)(y + 1) = 0\implies y = 2 \text{ or } y = -1$$ $$x = -1 \implies y^2 + y - 2 = (y + 2)(y - 1) = 0 \implies y = -2 \text{ or } y = 1$$
So it looks like the point at which $(x, y) = (1, 2)$ is a maximum, and the point $(x, y) = (-1, -2)$ is a minimum. Double check. This is consistent with the determination that the first derivative is zero when $y = 2x$: $x = 1 \implies y = 2$, and $x = -1 \implies y = -2$.
A: At the minimum and maximum values of $x$, the derivative $\frac{dy}{dx}$ must be equal to $0$ (in this case).
A: (originally posted on gamedev)
The general equation of an ellipse centered at the origin is:
$$(ax+by)^2+(cx+dy)^2=r^2$$
Expand w.r.t $x$ and $y$:
$$(a^2+c^2)x^2+(b^2+d^2)y^2+2(ab+cd)xy=r^2$$
An horizontal line has equation $y=k$. Either it intersects with the ellipse in two points, or it intersects in only one point (it's tangent), or it doesn't intersect at all. We find the intersection by solving the trinomial (in x):
$$(a^2+c^2)x^2+2(ab+cd)kx+(b^2+d^2)k^2-r^2=0$$
There is only one intersection when the discriminant is zero, hence you want to find $k$ such that
$$4(ab+cd)^2k^2-4(a^2+c^2)(b^2+d^2)k^2+4(a^2+c^2)r^2=0$$
Expand and simplify:
$$\left(a^2b^2+c^2d^2+2abcd-a^2b^2-a^2d^2-b^2c^2-c^2d^2\right)k^2+(a^2+c^2)r^2=0$$
$$(2abcd-a^2d^2-b^2c^2)k^2+(a^2+c^2)r^2=0$$
$$(ad-bc)^2k^2=(a^2+c^2)r^2$$
$$k=\pm\frac{r\sqrt{a^2+c^2}}{|ad-bc|}$$
The positive $k$ is the maximum value of $y$, the negative the minimum value. By symmetry of the ellipse, they are opposite.

The extreme values of $x$ can be found the same way, using a vertical line $x=l$. The same computation will lead to
$$l=\pm\frac{r\sqrt{b^2+d^2}}{|ad-bc|}$$
The positive $l$ is the maximum value of $x$, the negative the minimum value. Again, by symmetry of the ellipse, they are opposite.

The expressions found are not defined when $ad=bc$, but then the two squares in the original equation are proportional and the conic is degenerate (the equation leads to two parallel lines).
