# Why doesn't this approach work when solving the first-order differential equation?

Given the first-order differential equation: $$\frac{dy}{dx} = -6xy$$ The textbook says you cannot differentiate both sides as $$y$$ is on the right side and you have to use separation of variables. However, I did integrate both sides and arrived at this: $$\int{\frac{dy}{dx}dx} = \int{-6xydx}$$ $$y = -6y\int{xdx}$$ $$y = -6y\left(\frac{x^2}{2} + C\right)$$ $$y = -3yx^2 + C$$ $$y + 3yx^2 = C$$ $$y(1 + 3x^2) = C$$ $$y(x) = \frac{C}{1+x^2}$$

And the second last step is valid since $$1 + 3x^2$$ can never be zero. However, this is not the correct answer, which is: $$y(x) = Ce^{-3x^2}$$. Why is this?

• You cannot take $y$ off the integral, in the right part, since $y$ is a function of $x$. Feb 12, 2020 at 1:41
• Can't, yes? Okay, I see that, thanks very much. Feb 12, 2020 at 1:42
• How do I mark the comment as the solution? Feb 12, 2020 at 1:42
• @Mr.N So there is no other way to solve that integral on the right? Feb 12, 2020 at 1:44
• It's separable separate first then integrate Feb 12, 2020 at 1:47

Basically, you cannot take $$y$$ off the integral, in the right part, since $$y=y(x)$$. For example, if we have:

$$\displaystyle\int y(x) dx$$

If $$y(x) =e^x$$, then

$$e^x \neq e^x \displaystyle\int dx$$ $$e^x \neq e^x \cdot x$$

• So it is not possible to solve an integral with $y$ in it? Feb 12, 2020 at 1:45
• No, unless you have $y$ in terms of $x$ only. Like in the example above. Feb 12, 2020 at 1:45
• I mean for that equation $y$ is only in terms of $x$ it is just that I don't know what the function is. Feb 12, 2020 at 1:47
• That is it. If you knew, you could. Feb 12, 2020 at 1:48
• Okay, thanks. I will accept your answer when the time is done. Feb 12, 2020 at 1:50