Solve the following differential equation: $ty' + 2y = \sin(t)$

An exercise from the book:

Solve the following differential equation: $ty’ + 2y = \sin(t)$

This is the first time I approch a differential equation, and the book doesn’t provide an example how to solve an differential equation,

So I need your help to show me how to solve this differential equation.

It’s not a homework. Thanks in advance!

Solutions Collecting From Web of "Solve the following differential equation: $ty' + 2y = \sin(t)$"

The usual approach for an equation like this is to rewrite slightly, and then find an integrating factor:

$$y’ + \frac 2 t y = \frac{\sin t}{t}$$

We want to find a function $\mu$ so that the left hand side can be written as a single derivative; to this end, multiply through by $\mu$ to get

$$\mu y’ + \frac {2 \mu}{t} y= \mu \frac{\sin t}{t}$$

Now notice that the left hand side looks like product rule, if only we could write

$$\mu y’ + \frac{2\mu}{t} y = \mu y’ + \mu’ y$$

So if we can solve

$$\mu’ = \frac{2\mu}{t}$$

we’ll be a lot closer; but this can be solved using

$$\frac{2}{t} = \frac{\mu’}{\mu} = \left(\ln \mu\right)’$$

Integrating, and choosing the constant of integration so that $\mu(0) = 1$, this leads to

$$\ln \mu = 2 \ln t \implies \boxed{\mu = t^2}$$

So (provided $t \ne 0$) we can rewrite the original equation as

$$ (t^2 y)’ = t^2 y’ + 2t y = t \sin t$$

Now integrate and solve for $y$.


Consider the following ODE:

$$y'(t) + p(t) y(t) = F(t).$$

Suppose you are interested in rewriting this equation as follows:

$$ \frac{d}{dt}(I y) = I F,$$

for some function $I(t)\neq 0$ (called integrating factor). Expand the product of derivatives to find:

$$y’ + \frac{I’}{I} y = F, $$

so it must hold:

$$\frac{I’}{I} = p(t) \iff I(t) =e^{\int p(t) dt},$$ being the constant of integration set to 1 since it’s not relevant (both sides of the equation are multiplied by $I$). This leads you to the solution:

$$Iy = \int IF \, dt + A,$$

with $A$ a constant of integration.

Identify $p(t) = 2/t$ and $F(t) = \sin t/t$ in order to achieve the solution.