y1与x成正比例,y1=k1x
y2与x-2成正比例,y2=k2(x-2)
y=y1+y2=k1x+k2(x-2)
当x=-1时,y=-k1-3k2=2;
当x=2时,y=2k1=5;
∴k1=-3/2,k2=5/2
则y=-3/2 x+5/2(x-2)=x-5
y1与x成正比例,y1=k1x
y2与x-2成正比例,y2=k2(x-2)
y=y1+y2=k1x+k2(x-2)
当x=-1时,y=-k1-3k2=2;
当x=2时,y=2k1=5;
∴k1=-3/2,k2=5/2
则y=-3/2 x+5/2(x-2)=x-5