Find $f(4)$ where $f$ is a polynomial such that $f'(x)+f(x)=x$ 
$f(x)$ is polynomial function
and
  $$f'(x)+f(x)=x,$$ 
  then what is the value of $f(4)=$?
The Answer  is $f(4)=3$
   , but I don't know how?

 A: Hint. Let $f$ be a polynomial function of degree $n\geq 1$, then the degree of the polynomial $f'$ is $n-1$ and the degree of the sum $f+f'$ is still equal to $n$. Since $f'(x)+f(x)=x$, it follows that $n=1$ and $f(x)=ax+b$ for some constants $a$ and $b$. Hence
$$f'(x)+f(x)=a+ax+b=ax+(a+b)=x\Rightarrow \begin{cases}a=1\\a+b=0\end{cases}$$
A: What you have is called an Ordinary Differential Equation which can be solved by implementing a little trick that involves multiplying both sides by $e^x$ :
$$f'(x) + f(x) = x \Rightarrow e^xf'(x) + e^xf(x) = xe^x$$ 
Now, one can easily see that the RHS is : 
$$e^xf'(x) + e^xf(x) = [e^xf(x)]'$$
That means that you will now have : 
$$[e^xf(x)]'= xe^x \Rightarrow \int[e^xf(x)]'dx=\int xe^xdx \Rightarrow e^xf(x)= e^x(x-1)+c_1 $$
$$\Rightarrow$$ 
$$f(x) = (x-1) + c_1e^{-x}$$
Now, just find $f(2)$ to find that its value is, that it will be an expression involving the constant $c_1$. But be careful : since you need $f$ to be a polynomial, then the exponential factor should be diminished. That means that $c_1 = 0$, which leads to :
$$f(x) = x-1 \Rightarrow f(2) = 2-1=1$$
Note : As mentioned in the comments, please either check the exercise or the answer, since the answer for the particular problem is wrong.
A: Hint:
$$xe^x=\dfrac{d\{e^xf(x)\}}{dx}$$
Integrating both sides
$$e^xf(x)=\int xe^x\ dx$$
