TITLE: Find the general solution of the non-homogeneous equation.
QUESTION [5 upvotes]: Q. Find the general solution of the non-homogeneous equation.

$$\frac{dy}{dt}+y=te^t$$

So here are my steps:

Find $\mu (t)=e^t$
$y(t) e^t= \int e^t \times te^t$
So, I combined the terms and obtained:
$y(t) e^t= \int te^{2t} $

and from there I proceeded by integration by parts and got:
$$y(t) e^t= \frac{1}{2}t e^{2t}-\frac{1}{4}e^{2t}+c $$
then I divided by $e^t$
$$y(t)= \frac{\frac{1}{2}t e^{2t}-\frac{1}{4}e^{2t}+c}{e^t} $$
After simplifying, I obtained:
$$y(t)=\frac{1}{2}e^t[t-\frac{1}{2}]+c$$
which is the general solution.
I just want to someone to verify if I did everything correct.

REPLY [3 votes]: Almost: The correct solution is actually $$y(t)=\frac 12e^t\left(t-\frac 12\right)+ce^{-t}$$
Consider substituting this solution into your differential equation to verify that this is, indeed, a solution.
When I substituted your "solution" $y(t)=\frac 12 e^t(t-\frac 12)+c$, I ended up getting $$\frac{dy}{dt}+y=te^t+c.$$ The RHS of the above is not equal to $te^t$.