Question 558308
<pre>
{{{drawing(400,200,-4,4,-2,2,

rectangle(-2,-1,2,1),red(arc(0,0,4,2)),
line(-4,0,4,0), line(0,-2,0,2), locate(4,0,x), locate(0,2,y), locate(2,1.4,"(a,b)"), circle(-sqrt(2),-sqrt(2)/2,.05),circle(sqrt(2),sqrt(2)/2,.05),
green(line(-2,-1,2,1))  )}}}

We need to find the distance between the two points where the green line
intersects the red ellipse.

First find the equation of the green line:

It passes through the origin (0,0) and the point (a,b)

We find its slope:

m = {{{(y[2]-y[1])/(x[2]-x[1])}}}
 
m = {{{(b-0)/(a-0)}}} = {{{b/a}}}

Using the point-slope formula:

y - y<sub>1</sub> = m(x - x<sub>1</sub>)

y - 0 = {{{b/a}}}(x - 0)

y = {{{a/b}}}x

To find the endpoints of the chord, where
the green line intersects the red ellipse,
we solve the system of equations:

{{{system(x^2/a^2+y^2/b^2=1,y=expr(a/b)x)}}}

We clear each of fractions:

b²x² + a²y² = a²b²
         ay = bx

Square both sides of the second equation:

       a²y² = b²x²

Substitute b²x² for a²y² in 

b²x² + b²x² = a²b²

      2b²x² = a²b²

         x² = {{{(a^2b^2)/(2b^2)}}}

         x² = {{{a^2/2}}}

          x = {{{"" +- sqrt(a^2/2)}}} 

          x = {{{"" +- a/sqrt(2)}}}

          x = {{{"" +- (a*sqrt(2))/2}}} 

Substitute a²y² for b²x² in 

a²y² + a²y² = a²b²

      2a²y² = a²b²

         y² = {{{(a^2b^2)/(2a^2)}}}

         y² = {{{b^2/2}}}

          y = {{{"" +- sqrt(b^2/2)}}} 

          y = {{{"" +- b/sqrt(2)}}}

          y = {{{"" +- (b*sqrt(2))/2}}}

So the end points of the chord are

{{{(matrix(1,3,

-(a*sqrt(2))/2, ",", -(b*sqrt(2))/2 ))}}} and {{{(matrix(1,3,

(a*sqrt(2))/2, ",", (b*sqrt(2))/2 ))}}} 


We use the distance formula to find the length of the chord:

d = {{{sqrt((x[2]-x[1])^2+(y[2]-y[1])^2)}}}

d = {{{sqrt(((a*sqrt(2))/2-(-(a*sqrt(2))/2))^2+((b*sqrt(2))/2-(-(b*sqrt(2))/2))^2)}}}

d = {{{sqrt(((a*sqrt(2))/2+(a*sqrt(2))/2)^2+((b*sqrt(2))/2+(b*sqrt(2)/2))^2)}}}

d = {{{sqrt((a*sqrt(2))^2+(b*sqrt(2))^2)}}}

d = {{{sqrt(2a^2+2b^2)}}}

d = {{{sqrt(2(a^2+b^2))}}}

That's it.

Edwin</pre>