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

• Jun 27th 2007, 12:23 AM
cinder
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.
• Jun 27th 2007, 03:09 AM
CaptainBlack
Quote:

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

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