Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Henry T. Horton, Thomas, tomasz, Nate Eldredge, no identity Oct 6 '12 at 22:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
I couldn't get the answer from the responses in my previous question. I have indicated above where I am stuck. –  Ryan Oct 4 '12 at 22:34
    
Here is the solution. –  Mhenni Benghorbal Oct 5 '12 at 3:15

2 Answers 2

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

share|improve this answer

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

share|improve this answer
    
Yes, but.. if $c\in\mathbb R$ then $C=e^c>0$, and you got $C=-2e<0$.. –  Berci Oct 5 '12 at 0:04
    
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$ . –  doraemonpaul Oct 5 '12 at 1:10

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