How to solve the differential equation $yy' =-x$?

I just started learning about Differential Equations and there's this equation that I had problems with:

$$yy' =-x$$

I know that it's a separable ODE and that I can integrate both sides. The right side is then going to be $$-\frac{x^2}{2}+c$$ but I'm not sure how to go about the left side. I know that the solution is $$\frac{y^2}{2} = -\frac{x^2}{2}+c$$ but why is the left side equal to that? Usually $$\frac{y^2}{2}$$ is the anti-derivative of $$y$$ and not $$yy'$$. What am I missing here ?

Thanks.

• If you have function $y(x)$ then anti-derivative of $yy'$ is $\frac{y^2}{2}$ (To make sure, think about chain rule and find derivative of $\frac{y^2}{2}$) . – Soheil Nov 16 '20 at 20:56
• Try this: $y(x) = \pm \sqrt{c - x^2}$. – David G. Stork Nov 16 '20 at 21:01

$$y y' = -x$$ $$y \frac{dy}{dx} = -x$$ $$y dy = -x dx$$ This is what it means to separate it. Now only terms involving $$y$$ are on the left, and terms involving $$x$$ are on the right. So integrate... $$y^2/2 + C_1 = - x^2/2 + C_2$$ $$y^2 = -x^2 + C$$ $$y = \pm \sqrt{C-x^2}$$

As another user pointed out, you can also just recognize that $$(y^2)' = 2y y'$$

• Nice job. This is precisely what I would have posted +1 – amWhy Nov 16 '20 at 21:09
• Same. For practical purposes, "multiplying both sides by $dx$" is the way to go, even if it lacks rigour. But it can be justified, for those who care: math.stackexchange.com/a/47110/26091 – Théophile Nov 16 '20 at 21:11
• So it's basically just the chain rule? I think my mistake was in treating $y$ as a simple variable (like $x$) and forgetting that it's an actual function itself, would you agree? – Metrician Nov 16 '20 at 21:11

You have to take some care when you are dealing with multiple variables which may be dependent on each other. Here $$y'=\frac {dy}{dx}$$ is a derivative with respect to $$x$$ and you are taking the antiderivative with respect to the variable $$x$$ and not the variable $$y$$.

You need to take the same antiderivative on both sides of your equation. There are a number of ways of saying this, and a number of ways of using different notations for the same thing, so it is easy to get confused. But with any equation "do the same to both sides" is the basic rule (and even then there are some operations - eg taking square roots - which require care). Here the key is identifying what is "the same thing" that you are doing.

If you differentiate $$y^2$$ with respect to $$x$$ you will find that you get $$2yy'$$, while if you differentiate with respect to $$y$$ you get $$2y$$. Likewise taking the antiderivative is different in the two cases.

• Thanks for the detailed answer ! I guess my confusion came from me thinking about $y$ as a simple variable instead of treating it as a function of $x$ itself. – Metrician Nov 16 '20 at 21:15

It's true that: $$\dfrac {dy^2}{\color {red}{dy}}=2y$$ But when you differentiate $$y^2/2$$ with respect to the variable $$x$$ you get: $$\dfrac 12\dfrac {dy^2}{\color {red}{dx}}=\dfrac 12\dfrac {dy^2}{dy}\dfrac{dy}{dx}=y\dfrac {dy}{dx}=yy'$$ And you have also: $$\int yy'dx=\int y\dfrac {dy}{dx}dx=\int ydy= \dfrac {y^2}2+C$$

• No, $y^2/2$ is $\int y\ dy.\;$ See Jbag1212's answer. – amWhy Nov 16 '20 at 21:11
• Thanks @amWhy corrected. – Aryadeva Nov 16 '20 at 21:17

hint

You can easily check that The antiderivative of

$$\sin(x)$$ is not $$\frac{\sin^2(x)}{2}$$

But, you can be sure that the antiderivative of

$$\sin(x)\cos(x)$$ is $$\frac{\sin^2(x)}{2}$$.

do not forget to add a constant $$C$$.

$$\int x.1.dx =\frac{x^2}{2}$$ and by the same $$\int y(x).y'(x)dx=\frac{y^2(x)}{2}$$