Solving a first order ordinary differential equation that is not linear and not separable Problem:
Solve the following differential equations.
$$ ( 3x - y + 1 ) dx - ( 3x - y) dy = 0 $$
Answer:
I am going to use the substitution $z = 3x - y + 1$.
\begin{align*}
\frac{dz}{dx} &=3 - \frac{dy}{dx} \\
dz &=3 \, dx - dy \\
z + (z-1)( 3 - \frac{dz}{dx} ) &= 0 \\
z + 3(z-1) - (z-1)\frac{dz}{dx} &= 0 \\
4z - 1 - (z-1)\frac{dz}{dx} &= 0 \\
4z - 1 &= (z-1)\frac{dz}{dx} \\
\frac{dz}{dx} &= \frac{4z-3}{z-1} \\
dx &= \left( \frac{z-1}{4z-3} \right) \, dz
\end{align*}
Using long division, I find that:
\begin{align*}
\frac{z-1}{4z-3} &= \frac{1}{4} - \frac{ \frac{1}{4} } {4z-3} \\
\int \frac{z-1}{4z-3} \, dz &= \frac{z}{4} - \frac{1}{16} \ln{|4z-3|} + C_1 \\
x &= \frac{z}{4} - \frac{1}{16} \ln{|4z-3|} + C_1 \\
16x &= 4z - \ln{|4z-3|} + C_2 \text{ with } C_2 = 16C_1 \\
16x &= 12x - 4y + 4 - \ln{|12x  - 4y + 4 - 3|} + C_2 \\
4x &= -4y - \ln{|12x - 4y + 1|} + C \text{ with } \,\, C = C_2 + 4
\end{align*}
Now, I am going to check the answer by differentiating it.
\begin{align*}
4 &= -4 \frac{dy}{dx}- \frac{12 - 4\frac{dy}{dx}}{12x - 4y + 1} \\
4( 12x - 4y + 1) &= -4( 12x - 4y + 1)\frac{dy}{dx} - 12 + 4 \frac{dy}{dx} \\
48x - 16y + 4 &= ( -48x + 16y - 4)\frac{dy}{dx} - 12 + 4 \frac{dy}{dx} \\
48x - 16y + 16 &= ( -48x + 16y - 4)\frac{dy}{dx} + 4 \frac{dy}{dx} \\
48x - 16y + 16 &= ( -48x + 16y )\frac{dy}{dx} \\
(3x - y + 1 ) \, dx &= ( -3x + y) \, dy \\
(3x - y + 1 ) \, dx - ( -3x + y) \, dy &= 0 \\
\end{align*}
Hence the answers do not check but I am close. It looks like a sign error to me but I cannot seem to find it.

Making $u = 3x-y$ we have $\frac{du}{dx}=3-\frac{dy}{dx}$ and also
$$
u+1-u\frac{dy}{dx} = u+1-u\left(3-\frac{du}{dx}\right)=0
$$
and this DE now is separable
$$
\frac{u du}{2u-1} = dx
$$
or
$$
\frac 14\left(\ln(2u-1)+2u-1\right)=x + C_0
$$
or
$$
(2u-1)e^{2u-1}=C_1 e^{4x}
$$
and now using the Lambert function
$$
2u-1=W\left(C_1e^{4x}\right)
$$
and finally
$$
y = \frac 12\left(6x-1-W\left(C_1e^{4x}\right)\right)
$$
