Question in Differential Equation. (Don't know how to proceed) By using the substitution $y=vx$, find the particular solution of the differential equation $$2xy\frac{dy}{dx}=y^2-x^2$$, given that y=4 when x=2. Express in terms of x.
My attempt,
$$y=xv$$
$$\frac{dy}{dx}=v+x\frac{dv}{dx}$$
$$2x^2(x\frac{dv}{dx}+v)-x^2+x^2v^2$$
$$2x^2(x\frac{dv}{dx}+v)v=x^2(v^2-1)$$
$$\frac{dv}{dx}=\frac{-v^2-1}{2xv}$$
$$\frac{2\frac{dv}{dx}v}{-v^2-1}=\frac{1}{x}$$
$$\int \frac{2\frac{dv}{dx}v}{-v^2-1}=\int \frac{1}{x}dx$$
$$-ln (v^2+1)=\ln (x)+c_1$$
How do I simplify this? 
 A: Assuming that the work you have done is correct (I'm too lazy to check :P), apply the exponential function on the equation
\begin{align}
e^{-\ln(v^2+1)} &= e^{\ln(x)+c_1}\\
e^{\ln((v^2+1)^{-1})}&= e^{\ln(x)}e^{c_1}\\
(v^2+1)^{-1} &= xe^{c_1}\\
v^2+1 &= (xe^{c_1})^{-1}\\
v^2 &= \frac{1}{xe^{c_1}}-1\\
v &= \pm\sqrt{\frac{1}{xe^{c_1}}-1}\\
v &= \pm\sqrt{\frac{1}{c_2x}-1}
\end{align}
where $c_2 = e^{c_1}$.
A: exponentiating $$\ln (v^2 + 1) = -\ln x + \ln C, $$ you get 
$$ v^2 + 1 = \frac C x \to \frac{y^2 }{x^2} + 1=\frac C x \to y^2 = Cx - x^2\to y =\sqrt{Cx - x^2}$$  use the initial condition $y= 4, x = 2$ implies $4 = \sqrt{2C - 4}$ gives you $C = 10.$ therefore the solution is $$ y=\sqrt{10x - x^2}$$
A: here is another way to solve this. split $$\frac{dy}{dx} =\frac{y^2-x^2}{2xy} $$ into two equations $$\frac{dy}{dt} = \frac{y^2 - x^2}{2y},\, \frac{dt}{dx} = \frac 1{x},\, x = 2, y = 4 \text{ at } t = 0.$$  we can solve for $x$ and $$x = 2e^t. \tag 1$$ and the equation for $y$ is $$\frac{dy}{dt}= \frac{y^2 - 4e^{2t}}{2y}, u = y^2$$ turns this into $$\frac{du}{dt}= u - 4e^{2t}, u = 16 \text{ at } t = 0. $$ t so 
$$ u = Ae^{t} -4e^{2t} \to u = 20e^{t} - 4e^{2t} $$ we have 
$$y^2 = 20 e^{t} - 4e^{2t}  \tag 2 $$  finally,eliminating $t$ from $(1)$ and $(2),$
we get the same solution 
$$y^2 = 10x -  x^2, y = \sqrt{10x -x^2} $$ as before.
A: here is a third way, using integrating factor,  to solve this differential equation. write the differential equation as $$M\,dx + N\, dy = (x^2 - y^2)\, dx + 2xy \, dy = 0 $$ this differential equation is not exact because $M_y = (x^2 - y^2)_y = -2y \neq N_x = (2xy)_x=2y$ but almost.  we will look for a function, called an inegrating fator, $\mu$ so that $$\mu (x^2 - y^2)\, dx + 2\mu xy \, dy = 0 $$ is exact. the condition is $$ -2\mu y + (x^2 - y^2)\mu_y=\mu(x^2 - y^2)_y + (x^2 - y^2)\mu_y = (\mu2xy)_x=2y\mu + 2xy \mu_x$$ that is $$(x^2 - y^2)\mu_y - 2xy\mu_x = 4\mu y\tag 1$$ now, choose $\mu$ a function of $x$ alone, this turns the partial differential equation into an ordinary differential equation 
$$\frac{d\mu}{\mu} = -\frac{2dx}{x} \to \mu = \frac 1{x^2}.$$  therefore 
$$ 0=\frac{(x^2 - y^2)}{x^2}\, dx + \frac{2y}{x^2} \, dy = dx + d\left(\frac{y^2}{x}\right)$$ giving the integral $$x + \frac{y^2}{x} = 2 + \frac{16}2 = 10$$ and the solution is $$y = \sqrt{10x - x^2}. $$
