# Solving differential equation for streamline of a vector field

My Calculus book features the following sentence:

$$\frac{dy}{dx} = \frac{N}{M} = \frac{x}{y} \Rightarrow ydy = xdx \Rightarrow \frac{y^2}{2} - \frac{x^2}{2} = c$$

When trying to solve this equation myself, I did get to $ydy = xdx$ by muliplying both sides by $y$, then $dx$, but I don't get how you can get to the final result, since

$$\frac{y^2}{2} + C = \frac{x^2}{2} + C \equiv y = x, y=-x$$

I also try attempting to move the $x$ and $y$ terms to the left side, but my result is still far from desired:

$$C + \frac{x^2}{2} + \frac{y^2}{2} = C$$ There is an extra C on the left side, and the $x$ term is not negative.

Is integrating both sides of $ydy = xdx$ a wrong step? I do see that we are solving for $f(x,y) = c$, but how do I do this?

• when you integrate you get $y^2/2 + C = x^2/2 + C'$ with $C \ne C'$ in general, so that you finally have $y^2/2 - x^2/2 = c$, with $c = C' - C$ – jim Sep 10 '16 at 18:38

The constants of integration are arbitrary. So, the two constants are not the same $'C'$. Let them be labelled instead as $C_1$ and $C_2$. $$\int ydy=\int xdx$$ $$\frac{y^2}{2}+C_1=\frac{x^2}{2}+C_2$$ $$\frac{y^2}{2}-\frac{x^2}{2}=C_2-C_1=C$$
where we denote $C_2-C_1$ by $C$.
• Is there any rule for what constant is $C_2$ and $C_1$? My best guess is that it has something to do with $x$ being on the top of $\frac{x}{y} = \frac{dy}{dx}$. Would I get problems if I did $C_1 - C_2$ instead? – TheBro21 Sep 10 '16 at 19:08
• @TheBro21 $C_1$ and $C_2$ are just symbols to denote arbitrary constants. There is nothing special about labelling one $C_1$ and the other $C_2$, you can call them whatever you like. – GoodDeeds Sep 10 '16 at 19:12
• @TheBro21 Of course they are not equal in general. But the main point here is that they are just symbols, so if you interchange the use of $C_1$ and $C_2$, the change will be uniformly reflected everywhere. – GoodDeeds Sep 10 '16 at 19:27