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?
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$$