Celeb Glow
general | April 14, 2026

Solving differential equation $xdy + ydx = 0$

$\begingroup$

Solve following equation

$$xdy + ydx = 0$$

My process: group variables

$$xdy = -ydx \ \ \ ; \ \ \ \frac{x}{dx} = -\frac{y}{dy}$$

Integrate

$$\int{\frac{dx}{x}} = \int{\frac{-dy}{y}}$$ $$\ln |x| + K = - \ln |y| + K$$

Solution $$\ln|xy| = K$$

However my textbook gives answer:

$$xy = K$$

Where am I going wrong?

$\endgroup$ 1

3 Answers

$\begingroup$

Your approach is alright. Note that if $\ln A = k$, then $A = e^k$ and if $k$ is a constant, then so is $e^k$ and you could rename it to (for example) $K$.

Other approach (using the product rule):$$xdy+ydx = 0 \Leftrightarrow d(xy) = 0 \implies xy = C$$

$\endgroup$ 5 $\begingroup$

You aren't going wrong. Your solution and the textbook's solution are the same. $e^K$ is just some arbitrary constant where $K > 0$.

As a side note you should be more careful in naming your constants. You have $K$ on as the integration constant on both sides. The should be named something like $K_1$ and $K_2$ because they can (and probably are) different.

$\endgroup$ $\begingroup$

$$ Xdy + ydx =0 xdy = -- ydx 1/y dy = -- 1/x dx $$

Integrating both sides;$$ log |y| = -- log |x| + log |C| $$$$ log |y| + log |x| = log |C| $$$$ log |xy| = log |C| $$Comparing respective parts;$$xy = C$$$$ y = C/x $$, which is required general solution..

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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