# Find the solution of the differential equation that satisfies the given initial condition. `y' = (xysin(x))/(y+1)` `y(0) = 1`

*print*Print*list*Cite

This is an *ordinary differential equation *as it involves derivatives in the parameter y only. It is also *nonlinear *because the equation combines y and the derivative in y in a nonlinear fashion. In particular, there is a y/(1+y) term which is nonlinear in y. Finally it is *first order *as it involves y and only the first derivative of y and no further higher order derivatives (2nd, 3rd etc). Putting that all together we have that this is a *First order nonlinear ordinary differential equation. *Now we know what we're dealing with!

To solve differential equations of this type (the method extends to some other types, but let's focus on the type we have here), move terms involving y and its derivatives to the lefthand side, and terms involving x to the righthand side. It is convenient to rewrite y' as dy/dx as this separates this derivate into parts associated with y and x separately ('d' represents 'delta' - meaning, a tiny change in the variable). So, gather terms and write the equation as

`(y+1)/y quad dy = xsinx quad dx `

I've written the dy and dx slightly apart from the other parts of the equation to emphasise that these are single entities.

Now, the trick is to integrate on both sides. This seems unnatural at first, but note we are doing the same thing to both sides just like with any equation. What we have already is the areas under two separate curves, one in y and one in x, defined by multiplying the function at any point by a minuscule width. This is essentially a set of instructions of how to add up many very small columns under the curve. And the integral sign is the action of getting the areas under the curves, eliminating the tiny widths, using those instructions. So, adding the integral sign we write

`int (y+1)/y quad dy = int xsinx quad dx`

giving

`int 1 + 1/y quad dy = int xsinx quad dx`

The integral on the left is a simple one. The integral on the right is less simple, and needs to be done by parts. I will just give the solution to that, which you can work through. So, we have

`y + lny = -xcosx + sinx + c `

where `c ` is a constant of integration.

This is very nearly a solution, but we can now use the initial condition `y(0) =1 ` to find the value of `c `. The initial condition tells us that

`-0(cos(0)) + sin(0) + c = 1 ` which gives that

`0 + c = 1 ` `implies c = 1 `

**The final solution to the differential equation is then**

**`y + lny = -xcosx + sinx + 1 ` **

**Note this is an implicit and not explicit solution since y is not fully isolated by itself on the left side of the equation. This, I believe, is the only way to write this equation that involves only the variables y and x.**