I've been trying to solve the following differential equation:

$$3x+y(x)-2+\frac{dy(x)}{dx}(x-1)=0$$ And I found out it's an exact differential equation, since it can be rearranged as $(3x+y(x)-2)dx+(x-1)dy=0$

Assuming that a function $U(x,y)=\frac{\partial U}{\partial x}dx + \frac{\partial U}{\partial y}dy = k$, (where $k\equiv$ constant) exists, I calculated it as:

$$U(x,y)=\int (3x+y-2)dx + \int (x-1)dy=k$$

And I got $$y(x)=\frac{-3x^2}{2(2x-1)}+\frac{2x}{2x-1}+\frac{k}{2x-1}$$

But Mathematica says the solution is $$y(x)=\frac{-3x^2}{2(x-1)}+\frac{2x}{x-1}+\frac{k}{1-x}$$

So either I assumed something which isn't correct or I made a mistake along the process. Where did I go wrong?

Thanks everyone in advance!

  • $\begingroup$ $3x+y(x)−2$ is different form $3x+y(x)−x$ $\endgroup$ – Andrei Nov 1 '17 at 16:55
  • $\begingroup$ Sorry, that was a typo $\endgroup$ – Manuel Nov 1 '17 at 16:56
  • $\begingroup$ Well, your solution is correct! You can also double check your solution on WolframAlpha $\endgroup$ – Shadi Nov 1 '17 at 17:21
  • $\begingroup$ How is it correct? I see what you linked, but WolframAlpha also gives a different solution from the one I got. Is it because you can play with the coefficients since there is an arbitrary constant? $\endgroup$ – Manuel Nov 1 '17 at 17:26
  • $\begingroup$ @Manuel Check your solution again. $\endgroup$ – Nosrati Nov 1 '17 at 17:32

It can be seen as a linear differential equation:

$y' +\dfrac{y}{x-1} = \dfrac{2-3x}{x-1}$

Using integration factor $x-1$


$y (1-x) = 2x - \frac{3x^2}{2} + k$

Hope it helps


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.