$ty'+2y-t^2-t+1$ - what is the flaw in my solving approach? So, this is my attempt at solving the equation $$ty'+2y=t^2-t+1$$.Alas, I am not getting anything like the answer in the back of the book, which WolframAlpha confirms.  The positives in my answer are negatives in the book, and it's as if they integrated using T's to a lesser powre than I did.  Sadly, I went over this 10,000 times, and well, I can't get a different answer - at least I can't find a flaw in this procedure?

I suppose I'm more worried about the circled line and above.  I would appreciate anyone who can point out the flaw in my reasoning....
 A: I can't easily follow your handwritten work, but the trick here is easy enough:
Because we have $t$ mixed in with the $y'$ and $y$ terms, that suggests trying a substitution like
$$
y = zt^\alpha$$ for an $\alpha$ chosen to simplify the equation.
Then
$$
ty' +2y = t(z't^\alpha+\alpha zt^{\alpha-1}) + 2z t^\alpha = z't^{\alpha+1} + (2+\alpha)zt^\alpha$$ so since $2 + (-2) = 0$ choose $\alpha = -2$ (that is to say, $y=zt^{-2}$) which gives
$$
\frac{z'}{t} = t^2 - t + 1 \\
z' = t^3 - t^2 + t\\
z = \frac{t^4}{4} -\frac{t^3}{3} + \frac{t^2}{2}+C 
\\ y = \frac{t^2}{4} -\frac{t}{3} + \frac{1}{2}+C/t^2
$$
A: For the equation $t y' + 2 y = t^{2} - t + 1$ consider the operator 
\begin{align}
\frac{1}{\mu(t)} \partial_{t}( \mu(t) y) = y' + \frac{\mu'(t)}{\mu(t)} y.
\end{align} 
Now compare this to the equation at hand to obtain
\begin{align}
\frac{\mu(t)}{\mu(t)} = \frac{2}{t}
\end{align}
for which $\mu(t) = t^{2}$. Now the equation becomes, after multiplying by $t$,
\begin{align}
\partial_{t}( t^{2} y) &= t^{3} - t^{2} + t \\ 
t^{2} y &= \frac{t^{4}}{4} - \frac{t^{3}}{3} + \frac{t^{2}}{2} + c_{0} \hspace{5mm} \mbox{ after integration } \\
y(t) &= \frac{t^{2}}{4} - \frac{t}{3} + \frac{1}{2} + \frac{c_{0}}{t^{2}}
\end{align}
A: The error is in the second line. You went from
$$ty' + 2y = t^2 - t + 1$$
to
$$ y' + \frac{2}{t}y = t^2 - t + 1$$
Clearly you forgot to divide by $t$ on the RHS
