兩條曲線之間的最短距離(challenging)

2009-06-15 9:57 pm
找出兩條曲線y = x2和y = ln x之間的最短距離。

回答 (6)

2009-06-16 12:36 am
✔ 最佳答案
I will do it this way.
Suppose A(x1,x1^2) and B(x2,ln(x2)) are the points on the respective curves that the 2 curves are closest. Then the line joining these two points must be perpendicular to the tangents at those points. In other words, the tangent at A has a slope equal to the slope of the tangent at B.

Let the slope of the tangents be m.

For y=x^2
dy/dx=2x
slope at A is 2x1=m or x1=m/2
So point A becomes (m/2,m^2/4)

For y=ln(x)
dy/dx=1/x
slope at B is 1/x2=m or x2=1/m
So point A becomes (1/m,ln(1/m))

Slope joining A and B is [m^2/4-ln(1/m)]/(m/2-1/m)
which must equals to -1/m (since m1m2=-1 for perpendicular lines)

[m^2/4-ln(1/m)]/(m/2-1/m) = -1/m
m^3/4-mln(1/m)=1/m-m/2
m^3/4-mln(1/m)-1/m+m/2=0

Observing from the graph the approximate slope m for such curves should be around m=1. By using bisection method starting with (0.5,1.5), m is obtained as 1.076.

Minimum distance = sqrt{[m^2/4-ln(1/m)]^2+(m/2-1/m)^2}
=0.534

Please check if I made no mistake in my calculation.

2009-06-16 09:10:45 補充:
Using Lagrange Multiplier method, and use D^2 instead
(x1-x2)^2 + (y1-y2)^2 + L1(y1-x1^2)+L2(y2-ln(x2)) the partial derivatives yield:
2(x1-x2)-2L1x1=0...(1)
2(y1-y2)+L1=0...(2)
-2(x1-x2)-L2/x2=0...(3)
-

2009-06-16 09:10:53 補充:
-2(y1-y2)+L2=0...(4)
y1-x1^2=0...(5)
y2-ln(x2)=0...(6)
(1)&(2) => (y1-y2)/(x1-x2)=-1/2x1 (basically the same meaning as the line joining the 2 points are perpendicular to the tangent)
(3)&(4) => (y1-y2)/(x1-x2)=-x2
Manipulating these will yield exactly the equations done by dndmmokaa...
2009-06-17 8:21 pm
找出兩條曲線y = x2和y = ln x之間的最短距離。
我以下嘗試用變分法解決此一問題
考慮(x1,y1)在y=g(x)=x^2上﹐(x2,y2)在y=h(x)=ln x 上
現在考慮由(x1,y1)到(x2,y2)的最短曲線y。其曲線長度為
∫√1+(y')^2 dx [from x1 to x2]
記f(x,y)=√1+(y')^2
根據calculus of variations 的知識﹐所求曲線y必需符合以下三條件
(∂f / ∂y)- (d/dx)(∂f / ∂y')=0...(1)
g'(x)(∂f / ∂y')+f-y'(∂f / ∂y')=0...(2) [在(x1,y1)處]
h'(x)(∂f / ∂y')+f-y'(∂f / ∂y')=0...(3) [在(x2,y2)處]
∂f / ∂y = 0, ∂f / ∂y'=y'/[√1+(y')^2]
因此條件(1)成 (d/dx) {y'/[√1+(y')^2] }= 0 => y'= A (常數)
因此y=A+Bx (A,B 常數)
由(2): y1'/[√1+(y1')^2](2x1-y1')+[√1+(y1')^2]=0
但y1'=A=>A(2x1-A)+(1+A^2)=0=>x1=-1/(2A)
由(3): y2'/[√1+(y2')^2](1/x2-y2')+[√1+(y2')^2]=0
但y2'=A=>A(1/x2-A)+(1+A^2)=0=>x2=-A
因此y1=Ax1+B=B-1/2;y2=Ax2+B=B+A^2
又(x1,y1)在y=g(x)=x^2上﹐(x2,y2)在y=h(x)=ln x 上
y1=A^2,y2=lnA
故B-1/2=A^2;B+A^2=lnA
A^2+1/2=lnA-A^2
解之得A=-0.92907
因此x1=0.53817,x2=0.92907,y1=0.28963,y2=-0.0736
最短距離為0.5336

2009-06-17 14:08:00 補充:
應該是 y'= B (常數)
2009-06-17 2:17 am
By newton's method,
m≒1.076335441 (it takes me a long time to get this ans..., cor. to 10 sig.fig.),
where the min. distance ≒ 0.533587574

that is the barrier of fx-3650P T^T
2009-06-16 5:39 am
其實我原本想著嘗試用Lagrange Multiplier Method去解這題,minimize function很容易找出來,那是√((x1 - x2)² + (x1² - ln x2)²),但是我找不到constraints,所以就kick住了。因此我就發問了這條問題。
2009-06-16 12:50 am
好方法!解得妙!=]
2009-06-16 12:48 am
≒ 0.5336


收錄日期: 2021-04-23 23:19:38
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20090615000051KK00801

檢視 Wayback Machine 備份