f"(x)=sin(x), f'(x)=-cos(x)+A (A is constant to be determined);
f(x)=-sin(x)+Ax+B (B is constant to be determined).
f(0)=3, so 3=-sin(0)+0+B, making B=3.
f(π/2)=-sin(π/2)+Aπ/2+3=-1+Aπ/2+3=2-π/2,
2+Aπ/2=2-π/2, Aπ/2=-π/2, A=-1.
f(x)=-sin(x)-x+3 or 3-x-sin(x).