解:分离变量:xdy/dx=(xcotx-1)ydy/y=(cotx-1/x)dxdy/y=d(sinx)/sinx-dx/x两边积分得:lny=lnCsinx/xy=Csinx/x将y=2/π,x=π/2代入,得:2/π=C/(π/2)C=1故有:f(x)=sinx/x