Find the solution of the differential equation that satisfies the given initial condition $~y'=\frac{x~y~\sin x}{y+1}, ~~~~y(0)=1~$ Find the solution of the differential equation that satisfies the given initial condition $$~y'=\frac{x~y~\sin x}{y+1}, ~~~~~~y(0)=1~$$
When I integrate this function I get 
$$y+\ln(y)= -x\cos x + \sin x + C.$$
Have I integrated the function correctly? 
How do I complete the second part of the question $~y(0)=1~$
 A: What you can do is to use the so-called Separation of variables (see for example https://en.wikipedia.org/wiki/Separation_of_variables):


*

*Write $y' = \frac{dy}{dx}$

*Do the following transformation: $\frac{dy}{dx} = \frac{xy \sin(x)}{y+1} \Longleftrightarrow \frac{y+1}{y} dy = x\sin(x) dx$. Now integrate both sides (with respect to the corresponding variable), arriving at

*$\int (1 + \frac{1}{y}) dy = \int x \sin(x) dx \Longleftrightarrow y + \ln(y) = \sin(x) - x \cos(x) + C$.

*To get the integration constant $C$, set $x = 0$ and $y = 1$, then: $1 = 0 + C \Longleftrightarrow C = 1$.

*You'll not be able to solve the equation in 3 for the function $y = y(x)$ in terms of elementary functions (such as trigonometric functions, exponential/logarithmic functions etc.); But what you can do is to use the so-called Lambert W function, see https://en.wikipedia.org/wiki/Lambert_W_function. Then you will get $y(x) = W(e^{\sin(x) - x \cos(x) + 1})$.

A: we write the equation in the form
$$\left(1+\frac{1}{y}\right)dy=x\sin(x)dx$$
integrating we obtain
$$y+\ln|y|=\sin(x)-x\cos(x)+C$$
A: Given that $$~y'=\frac{x~y~\sin x}{y+1}$$
$$\implies \frac{dy}{dx}=\frac{x~y~\sin x}{y+1}$$
$$\implies \frac{y+1}{y}~dy=x\sin x~dx$$
$$\implies \left(1+\frac{1}{y}\right)~dy=x\sin x~dx$$
Integrating we have $$y+\log y=\int x\sin x~dx $$
$$\implies y+\log y=-~ x\cos x+\sin x~+~C\qquad \text{where $~C~$is integraating constant.}$$
Now given condition is $~~y(0)=1~~$, which gives $$1+0=0+0+C\implies C=1$$
So the solution of the differential equation that satisfies the given initial condition is $$y+\log y=-~ x\cos x+\sin x~+~1$$

Using integrating by parts rule:
$$\int x\sin x~dx =x\int \sin x~dx~-~\int \left(\frac{d}{dx}x~\int \sin x~dx\right)~dx$$
$$=-x~\cos x~-~\int \left(1\cdot~(-)~\cos x\right)~dx$$
$$=-x\cos x+\sin x$$
