$\begingroup$

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~$

nmasanta

8,432 25 gold badges 20 silver badges 43 bronze badges

asked Sep 19 '16 at 9:48

$\endgroup$

6

  • $\begingroup$ This is correct. Setting $x=0,\,y=1$ gives $C$. If you exponentiate both sides thereafter, you have $ye^y$ as a function of $x$. If you want $y$ as a function of $x$, see this: en.wikipedia.org/wiki/Lambert_w_function $\endgroup$

    Sep 19 '16 at 9:55

  • $\begingroup$ I managed to get C=1, so I now have y+ln(y)= -xcosx +sinx +1 How do I exponentiate both sides? $\endgroup$

    Sep 19 '16 at 10:03

  • $\begingroup$ Yes you have to exponentiate both sides as,$$ye^y=e^{1+sinx-xcosx}$$ So,$$y=W(e^{1+sinx-xcosx})$$refer link given by @J.G. $\endgroup$

    Sep 19 '16 at 10:15

  • $\begingroup$ Thanks so much for your help. I'm still not sure how you get the left hand side ye^y. I understand the right hand side $\endgroup$

    Sep 19 '16 at 10:32

  • $\begingroup$ @chelseathomson $e^{y+ln(y)}=e^ye^{ln(y)}=e^yy$ because $e^{ln(y)}=y$ $\endgroup$

    Sep 19 '16 at 11:11

3 Answers 3

$\begingroup$

What you can do is to use the so-called Separation of variables (see for example https://en.wikipedia.org/wiki/Separation_of_variables):

  1. Write $y' = \frac{dy}{dx}$
  2. 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
  3. $\int (1 + \frac{1}{y}) dy = \int x \sin(x) dx \Longleftrightarrow y + \ln(y) = \sin(x) - x \cos(x) + C$.
  4. To get the integration constant $C$, set $x = 0$ and $y = 1$, then: $1 = 0 + C \Longleftrightarrow C = 1$.
  5. 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})$.

answered Sep 19 '16 at 10:49

$\endgroup$

$\begingroup$

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$$

answered Sep 19 '16 at 10:49

$\endgroup$

6

  • $\begingroup$ Copying what is already in the question and not answering what is actually asked. $\endgroup$

    Sep 19 '16 at 11:17

  • $\begingroup$ you are don't sitting here to see if i have copied the answer $\endgroup$

    Sep 19 '16 at 11:18

  • $\begingroup$ What? My comment points out that your post "indicates" to the OP things they already know. (But hey, Dr., we all know you do not care, so why do you suddenly pretend you do?) $\endgroup$

    Sep 19 '16 at 11:22

  • $\begingroup$ the solution is a absolut value missing $\endgroup$

    Sep 19 '16 at 11:25

  • $\begingroup$ Which is irrelevant since $y(0)=1$. But if this is indeed your reason for copying parts of the question (which, somehow, I doubt...), you should indicate that is is in your post. $\endgroup$

    Sep 19 '16 at 11:31

$\begingroup$

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$$

answered Aug 5 '19 at 11:17

$\endgroup$

Not the answer you're looking for? Browse other questions tagged ordinary-differential-equations or ask your own question.