(1)∵圆x2+y2-4x-2y+5 2 =0,
∴圆(x-2)2+(y-1)2=5 2 ,
∴直径AB=2 5 2 = 10 ,
∵椭圆中心在原点,焦点在x轴上,
∴设椭圆:x2 a2 +y2 b2 =1(a>b>0),
又设A(x1,y1),B(x2,y2),弦AB中点(2,1)
∴x1+x2=4,y1+y2=2,
把A(x1,y1),B(x2,y2)分别代入椭圆:x2 a2 +y2 b2 =1,
得 x12 a2 +y12 b2 =1 x22 a2 +y22 b2 =1 ,∴b2(x1+x2)(x1-x2)+a2(y1+y2)(y1-y2)=0,
∴4b2(x1-x2)+2a2(y1-y2)=0,
∴k=y1−y2 x1−x2 =-2b2 a2 ,
∵离心率为 3 2 ,∴c a = 3 2 ,
∴c2 a2 =a2−b2 a2 =1-b2 a2 =3 4 ,∴b2 a2 =1 4 ,
∴k=y1−y2 x1−x2 =-2b2 a2 =-2×1 4 =-1 2 .
(2)∵AB的中点是(2,1),斜率k=-1 2 ,
∴AB的方程为:y=-1 2 x+2,
由(1)得a2=4b2,∴椭圆方程为x2+4y2-4b2=0,
将直线AB的方程y=-1 2 x+2,代入椭圆方程x2+4y2-4b2=0,得:
x2-4x+8-2b2=0,
∴x1+x2=4,x1x2=8-2b2,
|AB|= (1+1 4 )[16−4(8−2b2)] = 10 ,
解得b2=3,∴a2=12,
故椭圆的方程为:x2 12 +y2 3 =1.