[Math] Find the length of the chord joining the points in which the straight line $\frac{x}{a} + \frac{y}{b}= 1$ meets the circle $x^2+y^2=r^2$

conic sections

Question: Find the length of the chord joining the points in which the straight line $\frac{x}{a} + \frac{y}{b}= 1$ meets the circle $x^2+y^2=r^2$

My initial thoughts were rearranging the straight line equation into the form of $y=mx+c$ which means our equation becomes $y= b – \frac{bx}{a}$

So subbing this into our circle equation we get

$$ x^2 + (b – \frac{bx}{a})^2 = r^2$$

$$ \Leftrightarrow x^2 + b^2 – \frac{2b^2x}{a} + \frac{b^2x^2}{a^2} = r^2$$

$$ \Leftrightarrow a^2x^2+a^2b^2- 2b^2ax+b^2x^2-r^2a^2=0$$

$$ \Leftrightarrow (a^2+b^2)x^2-(2b^2a)x+a^2(b^2-r^2)=0$$

Now I was thinking of finding $(x_1-x_2)^2$ and $(y_1-y_2)^2$ and finding the length of the chord by using the distance formula but I want to know if I am on the right track.

— Attempt at it

So now to find the length of the chord we need to find $ \sqrt{ (x_1-x_2)^2 + (y_1+y_2)^2}$

Hence by vieta's formulas we get:

$$ \Rightarrow x_1+x_2 = \frac{2ab^2}{a^2+b^2} ~~~~{and} ~~~~ \Rightarrow x_1x_2 = \frac{a^2(b^2-r^2)}{a^2+b^2}$$

As $(x_1-x_2)^2 = (x_1+x_2)^2 -4x_1x_2$

$$ (x_1-x_2)^2 = \left(\frac{2ab^2}{a^2+b^2}\right)^2 – \frac{4a^2(b^2-r^2)}{a^2+b^2} $$

$$ \Leftrightarrow (x_1-x_2)^2 = \frac{4a^2b^4}{(a^2+b^2)^2} – \frac{4a^2(b^2-r^2)}{a^2+b^2} $$

$$ \Leftrightarrow (x_1-x_2)^2 = \frac{4a^2}{a^2+b^2} \left( \frac{b^4}{a^2+b^2} + r^2-b^2 \right)$$

$$ \Leftrightarrow (x_1-x_2)^2 = \frac{4a^2}{(a^2+b^2)^2} \left( {b^4} + r^2-b^2(a^2+b^2) \right)$$

$$ \Leftrightarrow (x_1-x_2)^2 = \frac{4a^2}{(a^2+b^2)^2} \left( {b^4} + (r^2-b^2)(a^2+b^2) \right)$$

$$ \therefore (x_1-x_2)^2 = \frac{4a^2}{(a^2+b^2)^2} \left( r^2a^2+r^2b^2-a^2b^2\right)$$

Now to find the corresponding $(y_1-y_2)^2$

As $y= b – \frac{bx}{a} = b(1-\frac{x}{a}) = \frac{b}{a}(a-x)$ then

$$ y_1+y_2 = \frac{b}{a}(a-x_1) + \frac{b}{a}(a-x_2)$$

$$ \Leftrightarrow y_1+y_2 = \frac{b}{a} (2a – (x_1+x_2)) $$

$$ \Leftrightarrow y_1+y_2 = \frac{b}{a} (2a – (\frac{2ab^2}{a^2+b^2}) $$

$$ \Leftrightarrow y_1+y_2 = 2b(1- \frac{b^2}{a^2+b^2}$$

$$ \Rightarrow y_1+y_2 = 2b(\frac{a^2}{a^2+b^2})$$

Now to find $y_1y_2$

$$ y_1y_2 = \frac{b}{a}(a-x_1)\frac{b}{a}(a-x_2) $$

$$ \Leftrightarrow y_1y_2 = \frac{b^2}{a^2}(a^2-x_1a-x_2a+x_1x_2)$$

$$ \Leftrightarrow y_1y_2 = \frac{b^2}{a^2}(a^2-a(x_1+x_2) + (x_1x_2))$$

$$ \Leftrightarrow y_1y_2 = \frac{b^2}{a^2}(a^2-a(\frac{2ab^2}{a^2+b^2}) + \frac{a^2(b^2-r^2)}{a^2+b^2})$$

$$ \Leftrightarrow y_1y_2 = \frac{b^2}{a^2}(a^2-\frac{2a^2b^2}{a^2+b^2}+ \frac{a^2(b^2-r^2)}{a^2+b^2})$$

$$ \Leftrightarrow y_1y_2 = b^2(1- \frac{2b^2}{a^2+b^2} + \frac{b^2-r^2}{a^2+b^2}) $$

$$ \Rightarrow y_1y_2 = \frac{b^2}{a^2+b^2}(a^2-r^2)$$

So $$(y_1-y_2)^2 = (y_1+y_2)^2-4y_1y_2$$

$$ \Leftrightarrow (y_1-y_2)^2 = \left( 2b(\frac{a^2}{a^2+b^2}) \right)^2 – \frac{4b^2}{a^2+b^2}(a^2-r^2) $$

$$ \Leftrightarrow (y_1-y_2)^2 = 4b^2(\frac{a^4}{(a^2+b^2)^2})- \frac{4b^2}{a^2+b^2}(a^2-r^2) $$

$$ \Leftrightarrow (y_1-y_2)^2 = \frac{4b^2}{a^2+b^2}(\frac{a^4}{a^2+b^2} + r^2-a^2) $$

$$ \therefore (y_1-y_2)^2 = \frac{4b^2}{(a^2+b^2)^2}(r^2a^2+r^2b^2-a^2b^2) $$

So Length of Chord is

$$ L = \sqrt{ (x_1-x_2)^2 + (y_1+y_2)^2}$$

$$L = \sqrt{ \frac{4a^2}{(a^2+b^2)^2} \left( r^2a^2+r^2b^2-a^2b^2\right) + \frac{4b^2}{(a^2+b^2)^2}(r^2a^2+r^2b^2-a^2b^2)}$$

$$ \Leftrightarrow L = \sqrt{ \left(\frac{4}{(a^2+b^2)^2}\right)(r^2a^2+a^2b^2r^2-a^4b^2+r^2a^2b^2+b^2b^4-a^2b^4) } $$

$$ \Leftrightarrow L = \frac{2}{a^2+b^2} \sqrt{2a^2b^2r^2 + r^2a^2-a^4b^2+b^2b^4-a^2b^4 } $$

Best Answer

Using Vieta's formula should help.

The distance between the line and the origin is $$\frac{|-ab|}{\sqrt{a^2+b^2}}$$ so, in the following, we may suppose that $$\frac{|-ab|}{\sqrt{a^2+b^2}}\le r.$$ Let $\alpha,\beta$ be the $x$ coordinates of the intersection points.

Then, by Vieta's formula, $$\alpha+\beta=\frac{2ab^2}{a^2+b^2},\quad \alpha\beta=\frac{a^2(b^2-r^2)}{a^2+b^2}$$

Using this, the length is given by $$\begin{align}\sqrt{(\alpha-\beta)^2+\left(\left(b-\frac{b\alpha}{a}\right)-\left(b-\frac{b\beta}{a}\right)\right)^2}&=\sqrt{\left(1+\left(-\frac ba\right)^2\right)(\alpha-\beta)^2}\\&=\sqrt{\frac{a^2+b^2}{a^2}((\alpha+\beta)^2-4\alpha\beta)}\end{align}$$

Therefore, the length is

$$2\sqrt{r^2-\frac{a^2b^2}{a^2+b^2}}$$