2
$\begingroup$

Possible Duplicate:
$dy/dx = y \sin x-2\sin x$, $y(0) = 0$ — Initial Value Problem

$\frac{dy}{dx} = y\sin x - 2\sin x,\quad y(0) = 0$

So, I get

$\frac{1}{y-2} dy = \sin x dx.$

Then, I integrated and got

$\ln(y-2) =-\cos x + C.$

Then, I did $e$^ both sides, but I end up with $\ln(-2)$ which is an error.

Can someone help me? Thank you.

  • 0
    Here is the [solution](http://math.stackexchange.com/questions/207401/dy-dx-y-sin-x-2-sin-x-y0-0-initial-value-problem/207412#207412).2012-10-05

2 Answers 2

0

Everything is fine, except that, as differentiating $ln(-x)$ one also gets $\displaystyle\frac{-1}{-x}=\frac1x$, so it can be $ln(2-y)$ as well.

That's how is meant $\displaystyle\int\frac1xdx=ln|x|$.

0

$\dfrac{dy}{dx}=y\sin x-2\sin x$

$\dfrac{dy}{dx}=(y-2)\sin x$

$\dfrac{dy}{y-2}=\sin x~dx$

$\int\dfrac{dy}{y-2}=\int\sin x~dx$

$\ln(y-2)=-\cos x+c$

$y-2=Ce^{-\cos x}$

$y=Ce^{-\cos x}+2$

$y(0)=0$ :

$Ce^{-1}+2=0$

$C=-2e$

$\therefore y=-2ee^{-\cos x}+2=2-2e^{1-\cos x}$

  • 0
    You don't need to worry. $e^c$ can be <0 , the only thing is that $c$ should be a complex number. Moreover, I consider $y=Ce^{-\cos x}+2$ for substitute $y(0)=0$ rather than consider $\ln(y-2)=-\cos x+c$ .2012-10-05