# Thread: y' + 3y = sin(x)

1. ## y' + 3y = sin(x)

Hi, can someone please check my work. I only have one chance to submit my answer online and I wanna be 100% sure.

$\displaystyle \frac{dx}{dy} + 3y = sin(x) , y(0) = 4$
$\displaystyle e^3 dx = e^{3x}$
$\displaystyle e^{3x} \frac{dx}{dy} + e^{3x}y = e^{3x}sin(x) dx$
$\displaystyle \int\frac{d}{dx} e^{3x}y = \int e^{3x}sin(x)$
$\displaystyle e^{3x}y = \frac{e^{3x}3sin(x)-cos(x)}{10} + c$
$\displaystyle y = \frac{3 sin(x) - cos(x)}{10}$

2. ## Re: y' + 3y = sin(x)

Originally Posted by JC05
Hi, can someone please check my work. I only have one chance to submit my answer online and I wanna be 100% sure.

$\displaystyle \frac{dx}{dy} + 3y = sin(x) , y(0) = 4$
$\displaystyle e^3 dx = e^{3x}$
$\displaystyle e^{3x} \frac{dx}{dy} + e^{3x}y = e^{3x}sin(x) dx$
$\displaystyle \int\frac{d}{dx} e^{3x}y = \int e^{3x}sin(x)$
$\displaystyle e^{3x}y = \frac{e^{3x}3sin(x)-cos(x)}{10} + c$
$\displaystyle y = \frac{3 sin(x) - cos(x)}{10}$
this is a mess

are you solving for an integrating factor? (yes) then make it clear.

$$\mu(x)=e^{\int 3dx}=e^{3x}$$

then

$$\mu(x)\frac{dy}{dx}+\mu(x)y = \mu(x)\sin(x) \Rightarrow$$

$$e^{3x}\frac{dy}{dx}+e^{3x}y=e^{3x}\sin(x)$$

$$\frac{d}{dx}\left(e^{3x}y\right)=e^{3x}\sin(x)$$

etc.

Then, you properly introduced the integration constant C, but then lost it.

You need to include that and solve for it given your initial condition.

Rework it.

3. ## Re: y' + 3y = sin(x)

Originally Posted by romsek
this is a mess

are you solving for an integrating factor? (yes) then make it clear.

$$\mu(x)=e^{\int 3dx}=e^{3x}$$

then

$$\mu(x)\frac{dy}{dx}+\mu(x)y = \mu(x)\sin(x) \Rightarrow$$

$$e^{3x}\frac{dy}{dx}+e^{3x}y=e^{3x}\sin(x)$$

$$\frac{d}{dx}\left(e^{3x}y\right)=e^{3x}\sin(x)$$

etc.

Then, you properly introduced the integration constant C, but then lost it.

You need to include that and solve for it given your initial condition.

Rework it.

I figured it out.....

$\displaystyle \int\frac{d}{dx} e^{3x}y = \int e^{3x}sin(x)$

$\displaystyle e^{3x} = \frac{e^{3x}(3sin(x) - cos(x)}{10} + C$

$\displaystyle y = \frac{e^{3x}(3sin(x) - cos(x)}{10} + e^{-3x}C$