# How do I solve this ODE?

$$ty' +y= 2t$$ I just don't get how to solve it. I tried dividing the equation by $t$ but that didn't lead me anywhere someone please help me with this

-

Hint: \begin{align} t \frac{dy}{dt} + y &= 2t \\ \frac{d}{dt}(ty)&=2t \\ d(ty) &= 2t \, dt \\ \int d(ty) &= \int 2t \, dt \end{align}

-

Hint: What is the derivative of $t\cdot y$ with respect to $t$? Use this to rewrite the left-hand side, which will make it easier to solve the equation.

Note: This is a particularly nice linear first-order ODE. Some will be less "obvious," and in such cases, you may want to use an integrating factor. I describe this method in more detail here, if you're curious.

-
Yeah I just realized that i was over thinking. I thought that the function had to be something more complicated the this –  H_Hassan May 29 '14 at 17:00
Well, you should get a general solution of $y=t+\frac Ct$ for some constant $C.$ This can be readily verified by substitution into the ODE. Don't worry about it, though. I'm a chronic overthinker, myself. –  Cameron Buie May 29 '14 at 17:01

$y'+\frac{1}{t}y=2$ is a linear first order differetial equation. There is a formula:

$y=e^{-\int (1/t)dt}\left(\int 2 e^{\int (1/t)dt}dt+C\right)=\frac{1}{t}(t^2+C).$

-
Isn't using an integrating factor better? –  BCLC May 29 '14 at 17:07
May be. I do not know. –  kmitov May 29 '14 at 17:12
@BCLC: That formula comes about from the use of an integrating factor. Basically, an integrating factor is to that formula as completing the square is to the quadratic formula. –  Cameron Buie May 29 '14 at 17:25
Yesm That is true. But formula is formula. It works well. –  kmitov May 29 '14 at 19:32
Oh right it does. But memorization is just so... mathwithbaddrawings.com/2013/09/10/… –  BCLC May 30 '14 at 11:19