# How to solve this first-order differential equation?

I have been trying to solve a differential equation as a practice question for my test, but I am just unable to get the correct answer. Please have a look at the D.E:
$dy/dx = 1/(3x+\sin(3y))$

My working is as follows:
$dx/dy = 3x+\sin(3y)$
$dx - 3x = \sin(3y) dy$
Integrating both sides:
$x-(3/2)x^2 = -(1/3)\cos(3y) + c$

$x = ce^3y - 1/6(\cos(3y) + \sin(3y))$, which is quite different from what I have got. Could someone please help me solve this? Thanks :)

• what you did is like integrating this way $\int{3x}$ which makes no sense. To integrate you should have a differential like $dx$ or $dy$... Besides you should get: $dx-3xdy=\sin{(3y)}dy$ – Oussama Boussif Sep 8 '15 at 19:29
• There is a mistake when you go from $dx/dy=3x+\sin(3y)$ to $dx-3x=\sin(3y)dy$. – DirkGently Sep 8 '15 at 19:32
• That was really silly of me! – John Sep 8 '15 at 19:59

The step you tried to do would have to read $dx=3x dy + \sin(3y) dy$, which is a bad sign: you have a function of $x$ multiplied with $dy$ which means the variables have not been separated. You also tried to integrate a $3x$ that had no $dx$, which does not make proper sense.

Instead of trying to think about it like separation of variables, notice that your new equation (after changing variables to $x(y)$ instead of $y(x)$) is linear, so you should solve it by the method of integrating factors. That is, you should have $\frac{d}{dy} \left ( e^{-3y} x \right ) = e^{-3y} \sin(3y)$ and now you just have an integral and some algebra to do.

• That was really silly of me. Thanks for the answer – John Sep 8 '15 at 20:00

HINT.....You need to use the integrating factor method.

Starting with $$\frac{dx}{dy}-3x=\sin 3y$$

The integrating factor is $$I=e^{-3dy}=e^{-3y}$$

Therefore $$xe^{-3y}=\int e^{-3y}\sin 3y dy$$