TITLE: If $f (x) +f'(x) = x^3+5x^2+x+2$ then find $f (x)$
QUESTION [6 upvotes]: If  $f (x) +f'(x) = x^3+5x^2+x+2$  then  find $f(x)$.

$f'(x)$ is the first derivative of $f (x)$.
I have no idea about this question, please help me.

REPLY [2 votes]: We can use an integrating factor, $u(x)$:
$$
\begin{align}
v(x)(f(x)+f'(x))
&=\frac{\mathrm{d}}{\mathrm{d}x}(u(x)\,f(x))\\
&=u'(x)\,f(x)+u(x)\,f'(x)\tag{1}
\end{align}
$$
If we set $\frac{u'(x)}{u(x)}=1$, we see that $(1)$ is satisfied. Thus, we get that we can use $u(x)=v(x)=e^x$. That is,
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}(e^x\,f(x))
&=e^x(f(x)+f'(x))\\
&=e^x\left(x^3+5x^2+x+2\right)\tag{2}
\end{align}
$$
Integrating $(2)$, we get
$$
e^x\,f(x)=e^x\left(x^3+2x^2-3x+5\right)+C\tag{3}
$$
and therefore,
$$
f(x)=x^3+2x^2-3x+5+Ce^{-x}\tag{4}
$$