Solve for x given y in ellipse

100 Views Asked by At

I have the following equation of an ellipse:

$$ C=(x-a)^2+(y-a)^2+bxy $$

I would like to solve the equation for $x$ given $y$. $C$, $a$, and $b$ are all constants which are given and do not need to be solved for.

The solution should be a real number, but does not need to be an integer. I understand some values of x may not exist on the ellipse and there will be more than 1 x for a given y. My aim is to just re-write the above equation in terms of $x=$ ...

My first approach is to use Completing the Square or the Quadratic Formula. I found this math exchange post to helpful in applying Completing the Square

The equation can be re-written as:

$$ C-2a^2=x^2+bxy+y^2-2ax-2ay $$

which produces this $x^2+bxy+y^2$, which seems helpful but the math exchange post above solves for $x^2-xy+y^2$ which it isn't exactly the same. I think if I could apply the concept from the math exchange post but for $x^2+bxy+y^2$, that would get me very close to the solution.

--

Using the suggestion (comment) from @dxiv, we can re-write this as:

$$ C-a^2=x^2+x(by-2a)+y^2-2ay+a^2 $$

which can then be solved by completing the square.

I appreciate any help.

1

There are 1 best solutions below

0
On BEST ANSWER

As @dxiv suggested and you have done, $$x^2+(by-2a)x+(y^2-2ay+2a^2-C)=0$$ Let $by-2a=k$ and $y^2-2ay+2a^2-C=l$, where both quantities are known. Then using the quadratic formula, we have: $$x=\frac {-k \pm \sqrt{k^2-4m}}{2}$$ The quadratic formula itself comes from the completing of square method, to see this, we have: $$(x^2-2(\frac k2)x+\frac {k^2}{4})+m-\frac {k^2}{4}=0$$ Hence we have $x$ in terms of $y$. Note how for every $y$, if $D>0$, we get $2$ distinct values of $x$, which is what you would expect from an ellipse.