Given,
f(x)=∫0xex−tf′(t)dt−(x2−x+1)ex
⇒f(x)=ex∫0xe−tf′(t)dt−(x2−x+1)ex
⇒e−xf(x)=∫0xe−tf′(t)dt−(x2−x+1)
Differentiate on both side w.r.t x we get,
e−xf′(x)+(−f(x)e−x)=e−xf′(x)−2x+1
⇒f(x)=ex(2x−1)
⇒f′(x)=ex(2)+ex(2x−1)
⇒f′(x)=ex(2x+1)......(1)
Now finding critical point we get,
2x+1=0⇒x=−21
Now differentiating equation (1) to check maxima and minima we get,
f"(x)=ex(2)+(2x+1)ex
⇒f"(x)=ex(2x+3)
For x=−21,f"(2−1)>0, so it will give point of minima,
Now minimum value will be given by, f(2−1)=e−21(−1−1)=−e2