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

• June 27th 2007, 01:23 AM
cinder
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.
• June 27th 2007, 04:09 AM
CaptainBlack
Quote:

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
• June 27th 2007, 04:11 AM
galactus
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}$
• June 27th 2007, 10:05 AM
cinder
I guess I'm not seeing how it can be rewritten as $\frac{d}{dx}(xy)=sin(x)$.
• June 27th 2007, 10:48 AM
topsquark
Quote:

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