Find $f(x)$ from the differential equation $f(x)+{f}'(x) = x^{3} +5x^{2} +x +2$ find $f(x)$ from
$f(x)+{f}'(x) = x^{3} +5x^{2} +x +2$.
I tried to impose $f(x)$ and $f'(x)$ but i can not solve it.
 A: Note that $$e^x f(x) + e^x f'(x) = (e^x f(x))'$$
So if we multiply both sides of your equation by $e^x$ we have:
$$(e^x f(x))' = x^3e^x+5x^2 e^{x} + xe^x + 2e^x$$
So the solution can be found through integration:
$$e^x f(x) - e^{0}f(0) = \int_0^x (t^3 e^t + 5t^2 e^t + te^t + 2e^t) dt$$ and the right hand side can be evaluated using integration by parts. Finally you will need to multiply both sides by $e^{-x}$ to solve for $f(x)$:
$$f(x) = e^{-x} f(0) + e^{-x} \cdot \int_0^x (t^3 e^t + 5t^2 e^t + te^t + 2e^t) dt.$$
A: If f(x) is a polynomial,
Let $f(x)=ax^3+bx^2+cx+d$
Then $f'(x)=3ax^2+2bx+c$
Therefore $f(x)+f'(x)=ax^3+(3a+b)x^2+(2b+c)x+(c+d)$
$a=1, b=2, c=-3,d=5$
EDIT
If $f(x)$ is partially polynomial.
Let $f(x)=g(x)+h(x)$, where $g(x)$ is polynomial and $h(x)$ is non-polynomial,
$f'(x)=g'(x)+h'(x)$
when $f(x)+f'(x)=[g(x)+g'(x)]+[h'(x)+h(x)]=G(x)+H(x)$
where $G(x)=x^3+5x^2+x+2$
And for any  ${x:h(x)+h'(x)=0}$, the non-polynomial part is cancelled.
e.g. $h(x)=e^{-x}, h'(x)=-e^{-x}$
$f(x)=x^3+5x^2+x+2+h(x)$
A: $f(x)=x^3+2x^2-3x+5$ is a solution.  This can be obtained by guessing a degree 3 polynomial will work, and then working one coefficient at a time.
For example, lead coefficient must be 1.  Then derivative of $x^3$ is $3x^2$, so I still need $2x^2$.  This must be the second term.  Continue until you know all coefficients.  
Solution of the homogeneous form $f(x) + f'(x)=0$ is seen to be $Ce^{-x}$ fairly easily.
So $x^3+2x^2-3x+5+Ce^{-x}$ is the general solution.
A: for the equation $y'(x)+y(x)=0$ you will get $y(x)=Ce^{-x}$ and for the inhomogeneous part make the ansatz
$y(x)=Ax^3+Bx^2+Cx+D$
A: A method suitable for lazy people. We can write the particular solution formally  as:
$$f(x) = \frac{1}{1+D}\left(x^3 +5x^2 + x + 2\right)$$
where $D$ is the differential operator. If we substitute the formal expansion:
$$\frac{1}{1+D} = \sum_{k=0}^{\infty}(-1)^k D^k$$
then this yields:
$$f(x) = x^3 +2 x^2 -3 x +5$$
A: It's actually easier to use the method undetermined coefficients
The complementary solution that solves the homogeneous equation is
$$ y_c(x) = Ce^{-x} $$
The particular solution can be found by setting
$$ y_p(x) = Ax^3 + Bx^2 + Cx + D $$
Taking the derivative and plugging back into the equation
$$ Y_p' = 3Ax^2 + 2Bx + c$$
$$ y_P' + y_p = Ax^3 + (3A+B)x^2 + (2B+C)x + (C+D) =x^3 + 5x^2 + x + 2 $$
Equating the coefficients will give you values of $A,B,C,D$
$$ \begin{cases} A = 1 \\ 3A+B = 5 \\ 2B+C = 1 \\ C+D = 2 \end{cases}$$
Finally, the general solution is
$$ y_g(x) = y_c(x) + y_p(x) $$
