f '(x)=e^x+(x-k)e^x=(x-k+1)e^x
令f '(x)=0
得x-k+1=0
x=k-1
①当k-1≤0,即k≤1时,在x∈【0,1】上恒有f '(x)>0,故f(x)为增函数,在x=0处取得最小值f(0)=-k
②当0<k-1<1,即1<k<2时,
1)当x∈【0,k-1)时,f '(x)<0,f(x)为减函数
2)当x∈(k-1,1】时,f '(x)>0,f(x)为增函数
故f(x)在x=k-1处取值最小值f(k-1)=(k-1-k)e^(k-1)=-e^(k-1)
③当k-1≥1,即k≥2时,在x∈【0,1】上恒有f '(x)<0,故f(x)为减函数,在x=1处取得最小值f(1)=(1-k)e