# What is the general solution of the differential equation  xdy/dx = y+sinx ?

Sep 18, 2017

$y = x C i \left(x\right) - \sin x + C x$

Where $C i \left(x\right)$ is the Cosine Integral

#### Explanation:

We have:

$x \frac{\mathrm{dy}}{\mathrm{dx}} = y + \sin x$ ..... [A]

This is a First Order Differential Equation which we can manipulate as follows:

$\setminus \setminus \setminus \setminus \setminus \frac{\mathrm{dy}}{\mathrm{dx}} = \frac{y}{x} + \sin \frac{x}{x}$

$\therefore \frac{\mathrm{dy}}{\mathrm{dx}} - \frac{y}{x} = \sin \frac{x}{x}$ ..... [B]

We can use an integrating factor when we have a First Order Linear non-homogeneous Ordinary Differential Equation of the form;

$\frac{\mathrm{dy}}{\mathrm{dx}} + P \left(x\right) y = Q \left(x\right)$

Then the integrating factor is given by;

$I = {e}^{\int P \left(x\right) \mathrm{dx}}$
$\setminus \setminus = \exp \left(\int \setminus - \frac{1}{x} \setminus \mathrm{dx}\right)$
$\setminus \setminus = \exp \left(- \ln x\right)$
$\setminus \setminus = \exp \left(\ln \left(\frac{1}{x}\right)\right)$
$\setminus \setminus = \frac{1}{x}$

And if we multiply the DE [B] by this Integrating Factor, $I$, we will have a perfect product differential;

$\frac{1}{x} \frac{\mathrm{dy}}{\mathrm{dx}} - \frac{y}{x} ^ 2 = \sin \frac{x}{x} ^ 2$
$\therefore \frac{d}{\mathrm{dx}} \left(\frac{y}{x}\right) = \sin \frac{x}{x} ^ 2$

Which has now reduced the original differential equation [A] to a First Order separable equation, so we can "seperate the variables" , to get:

$\frac{y}{x} = \int \setminus \sin \frac{x}{x} ^ 2 \setminus \mathrm{dx}$ ..... [C]

The RHS will prove a challenge, but we can simplify it slightly using a single application of Integration By Parts:

Let $\left\{\begin{matrix}u & = \sin x & \implies \frac{\mathrm{du}}{\mathrm{dx}} & = \cos x \\ \frac{\mathrm{dv}}{\mathrm{dx}} & = \frac{1}{x} ^ 2 & \implies v & = - \frac{1}{x}\end{matrix}\right.$

Then plugging into the IBP formula:

$\int \setminus \left(u\right) \left(\frac{\mathrm{dv}}{\mathrm{dx}}\right) \setminus \mathrm{dx} = \left(u\right) \left(v\right) - \int \setminus \left(v\right) \left(\frac{\mathrm{du}}{\mathrm{dx}}\right) \setminus \mathrm{dx}$

gives us

$\int \setminus \left(\sin x\right) \left(\frac{1}{x} ^ 2\right) \setminus \mathrm{dx} = \left(\sin x\right) \left(- \frac{1}{x}\right) - \int \setminus \left(- \frac{1}{x}\right) \left(\cos x\right) \setminus \mathrm{dx}$
$\therefore \int \setminus \sin \frac{x}{x} ^ 2 \setminus \mathrm{dx} = - \sin \frac{x}{x} + \int \cos \frac{x}{x} \setminus \mathrm{dx}$

Using this result, we can integrate the earlier result [C] to get:

$\frac{y}{x} = - \sin \frac{x}{x} + \int \cos \frac{x}{x} \setminus \mathrm{dx} + C$

So we have simplified the integral, but we cannot now evaluate this resulting integral any further in terms of elementary functions. Instead we introduce the Cosine Integral:

$C i \left(x\right) : = - {\int}_{0}^{\infty} \cos \frac{t}{t} \setminus \mathrm{dt}$

Allowing us to write:

$\frac{y}{x} = C i \left(x\right) - \sin \frac{x}{x} + C$

$\therefore y = x C i \left(x\right) - \sin x + C x$