Answer
$y=-te^{-t}+Ct$
Work Step by Step
$ty'-y=t^2e^{-t}$
First, write the equation in standard form by dividing both sides by $t$:
$y'-\frac{y}{t}=te^{-t}$
Next, notice this can be solved using the integrating factor $\mu(t)$:
$p(t) = -\frac{1}{t}$
$\mu(t)=e^{\int p(t)dt}=e^{\int(-\frac{1}{t})dt}$
$\mu(t)=e^{-ln|t|}=e^{ln|t^{-1}|}=t^{-1}$
Now, multiply both sides of the equation by $\mu(t)$:
$\frac{1}{t}(y'-\frac{y}{t}=te^{-t})$
$t^{-1}y'-t^{-2}y=e^{-t}$
Notice the left hand side of the equation $= t^{-1}y'-t^{-2}y=(t^{-1}y)'$
$(t^{-1}y)'=e^{-t}$
Then, integrate both sides:
$\int(t^{-1}y)'dt=\int e^{-t}dt$
$t^{-1}y=-e^{-t}+C$
$y=-te^{-t}+Ct$