Finding solution of $y' = \frac{(y^2 - 4yt + 6t^2)}{t^2}$ with initial condition $y(2) = 4$ Concerning the ordinary differential equation
$$y' = \frac{(y^2 - 4yt + 6t^2)}{t^2}$$
with initial condition $y(2) = 4$.
My text book gives the solution as $y = 2t$, and so does MATLAB.
However, I only see the following :
\begin{align}
v &= \frac{y}{t}\\
y' &= v^2 - 4v + 6\\
tv' + v &= v^2 - 4v + 6\\
tv'&= v^2 - 5v + 6\\
\end{align}
\begin{align}
\frac{dv}{(v-3)(v-2)} &= \frac{dt}{t}\\
\frac{dv}{(v-3)} - \frac{dv}{(v-2)} &= \frac{dt}{t}\\
\ln(|v-3|) - \ln(|v-2|) &= \ln(|t|) + c\\
\frac{v-3}{v-2} = te^{c}\\
\end{align}
which then reduces to
$$v = \frac{3 - 2te^{c}}{1-te^{c}}$$
and
$$y = \frac{t(3 - 2te^{c})}{1-te^{c}}$$
There must be at least some logic to this, because several online calculators (for example WolframAlpha) give the same result. But nevertheless it seems wrong, as the initial condition implies
$4 - 8e^{c} = 6 - 8e^{c}$?
Can someone please explain to me how to arrive at $y=2t$, and where I would have gone wrong?
 A: We can rewrite the differential equation in the following way
$$y' - 2 = \frac{(y-2t)^2}{t^2}$$
where we can now use the substitution $v = y-2t$
$$v' = \frac{v^2}{t^2} \implies v = \frac{t}{1+Ct}$$
Then plug in the initial condition $v(2) = y(2)-2\cdot 2 = 0$. However, notice that the "general solution" has a singularity there. The resolution is that we assumed $v$ was nonzero when we separated variables, which we can't do. Fortunately for us, $v(t) = 0$ is a solution to the original ODE. This means that
$$y(t) = v(t) + 2t = 2t$$
A: You've shown
$$ tv' = v^2 - 5v + 6 = (v-2)(v-3).$$
and since $v = y/t$, the initial condition gives $v(2)  =2$. Thus
$$\frac{dv}{(v-3)(v-2)} = \frac{dt}{t}$$
cannot be done since $v-2$ is at the bottom.
This is exactly the case where sometimes separation of variable does not work: indeed for a simple problem like
$$ y' = y, \ \ \ y(0) = 0,$$
you cannot use separation of variable to find the solution (which is $y(t) = 0$).
To "find" the solution $y = 2t$, you simply observe that $v(t) = 2$ is a solution, and then from the uniqueness theorem to ODE, it is THE solution.
A: $$y' = \frac{(y^2 - 4yt + 6t^2)}{t^2}$$
$$y't^2=(y-2t)^2+2t^2$$
$$t^2(y'-2)=(y-2t)^2$$
$$t^2(y-2t)'=(y-2t)^2$$
Substitute $z=y-2t$
$$t^2z'=z^2  \implies z'=\left ( \dfrac zt \right)^2=f(z,t)$$
With intial condition:
$$z(2)=0$$
Since $z(t)=0$ is a solution and by the uniqueness theorem ($f$ and $\partial_z f$ are continuous on $t \in (0,\infty]$), the only solution is therefore $z(t)=0 \implies y(t)=2t$.
