# Thread: I lied, one more (first-order DE). :)

1. ## I lied, one more (first-order DE). :)

$\displaystyle x\frac{dy}{dx}+y=\sin(x)$, $\displaystyle x>0$, initial condition: $\displaystyle y(\frac{\pi}{2})=1$

What I have so far...

$\displaystyle \frac{dy}{dx}+\frac{1}{x}y=\frac{\sin(x)}{x} \Rightarrow \int \frac{1}{x}dx=\ln|x| \Rightarrow e^{\ln|x|}=x$

I'm not sure if I did the previous part right. And after that I'm unsure how to proceed.

2. Originally Posted by cinder
$\displaystyle x\frac{dy}{dx}+y=\sin(x)$, $\displaystyle x>0$, initial condition: $\displaystyle y(\frac{\pi}{2})=1$

What I have so far...

$\displaystyle \frac{dy}{dx}+\frac{1}{x}y=\frac{\sin(x)}{x} \Rightarrow \int \frac{1}{x}dx=\ln|x| \Rightarrow e^{\ln|x|}=x$

I'm not sure if I did the previous part right. And after that I'm unsure how to proceed.
$\displaystyle x\frac{dy}{dx}+y=\sin(x)$

may be written as:

$\displaystyle \frac{d}{dx} (x~y) =\sin(x)$

so:

$\displaystyle x~y = -\cos(x) +C$

and the rest should be simple.

RonL

3. You're OK so far. You have your integrating factor.

$\displaystyle \frac{d}{dx}(xy)=sin(x)$

Integrate:

$\displaystyle \int\frac{d}{dx}(xy)=\int{sin(x)}dx$

$\displaystyle xy=-cos(x)+C$

$\displaystyle y=\frac{-cos(x)}{x}+\frac{C}{x}$

IC is $\displaystyle y(\frac{\pi}{2})=1$

Using this and solving for $\displaystyle C=\frac{\pi}{2}$

Therefore, you have:

$\displaystyle y=\frac{\pi}{2x}-\frac{cos(x)}{x}$

4. I guess I'm not seeing how it can be rewritten as $\displaystyle \frac{d}{dx}(xy)=sin(x)$.

5. Originally Posted by cinder
I guess I'm not seeing how it can be rewritten as $\displaystyle \frac{d}{dx}(xy)=sin(x)$.
Think of it this way:
$\displaystyle \frac{d}{dx}(xy) = 1 \cdot y + x \frac{dy}{dx}$
by the product rule.

So
$\displaystyle \frac{d}{dx}(xy) = y + x \frac{dy}{dx} = sin(x)$