Is there a function $f$ such that $f'(x)=2x+f(x)$? Is there a function $f:\Bbb R \to \Bbb R$ such that $f'(x)=2x+f(x)$?
I've been trying to find it by inspection but I haven't found it, so now I'm wondering if it actually exists.
 A: A solution is $e^x - 2x - 2$, but there are many others, in fact $ke^x - 2x - 2$ is a solution as well as you can easily check.
It is very easy to find (both online and in every book about ODEs) a way of finding solutions to such problems (look for first order linear inhomogeneus differential equations)
A: Yes.  The answer has a homogeneous solution and a particular solution.  But the standard approach uses an integrating factor to integrate the first-order differential operator (here, $f'-f$).  Here, the integrating factor is $e^{-x}$.  So, 
$$[e^{-x}f(x)]'=2xe^{-x}$$ which after integrating both sides (by parts on the right-hand side) and solving for $f$ yields$$f(x)=-2(x+1)+Ae^x$$
A: The solution is of the form $y=Ae^x+mx+b$ and you can find the values of $m$ and $b$ through substitution into your given equation, which is what I want YOU to do...
A: Here's an idea. If you rearrange the equation slightly, you get
$$-f(x)+f'(x) = 2x.$$
Multiplying both sides by $e^{-x}$ we get
$$-e^{-x}f(x)+e^{-x}f'(x) = 2xe^{-x}.$$
If you look at the left hand side, it resembles the derivative of a product of two functions (try to reverse the product rule).. Can you take it from here?
