若椭圆x^2/m^2+y^2/n^2=1(m,n>0)经过点(3,1),求m^2+n^2的值