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

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

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

What I have so far...

$\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
$x\frac{dy}{dx}+y=\sin(x)$, $x>0$, initial condition: $y(\frac{\pi}{2})=1$

What I have so far...

$\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.
$x\frac{dy}{dx}+y=\sin(x)$

may be written as:

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

so:

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

and the rest should be simple.

RonL

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

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

Integrate:

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

$xy=-cos(x)+C$

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

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

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

Therefore, you have:

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

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

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

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