<s>[INST] Solution to $y' + \frac xy = 1$ $y' + \frac xy = 1$
I've identified it as a homogeneous differential equation and transformed it to $xv' + v = 1-\frac 1v$ (where $v = \frac yx$) but am stuck here.
 [/INST] $$
\begin{aligned}
y' + \frac{x}{y} = 1 &\Leftrightarrow 
\left|
\begin{aligned}
y(x) &= z(x)\cdot x \\
y'(x) &= z'(x)x + z(x)
\end{aligned}
\right| \Leftrightarrow \\
&\Leftrightarrow z'x + z + \frac{x}{zx} = 1 \Leftrightarrow \\
&\Leftrightarrow z'x + z + \frac{1}{z} = 1 \Leftrightarrow \\
&\Leftrightarrow z' = -\frac{1}{x}\frac{z^2-z+1}{z}\Leftrightarrow \\
&\Leftrightarrow z' = -\frac{1}{x}\frac{z^2-z+1}{z}\Leftrightarrow \\
&\Leftrightarrow \frac{zdz}{z^2-z+1} = -\frac{dx}{x} \Leftrightarrow \\
&\Leftrightarrow \int\frac{zdz}{z^2-z+1} = -\int\frac{dx}{x}
\end{aligned}
$$
Left-hand side integral:
$$
\begin{aligned}
\int\frac{zdz}{z^2-z+1} &= \frac{1}{2}\int\left(\frac{2z-1}{z^2-z+1} + \frac{1}{z^2-z+1}\right)dz = \\
&= \frac{1}{2}\left(\int\frac{d(z^2-z+1)}{z^2-z+1}+\int\frac{dz}{\left(z-\frac{1}{2}\right)^2 +\left(\frac{\sqrt{3}}{2}\right)^2}\right) = \\
&= \frac{1}{2}\left(\text{ln}\left(z^2-z+1\right) + \frac{2}{\sqrt{3}}\arctan\left(\frac{2\left(z-\frac{1}{2}\right)^2}{\sqrt{3}}\right)\right).
\end{aligned}
$$
Right-hand side integral:
$$
-\int\frac{dx}{x} = -\text{ln}(x) + C.
$$
Finaly ($z = \frac{y}{x}$),
$$
\frac{1}{2}\text{ln}\left(\frac{y^2}{x^2}-\frac{y}{x}+1\right) + \frac{1}{\sqrt{3}}\arctan\left(\frac{2\left(\frac{y}{x}-\frac{1}{2}\right)^2}{\sqrt{3}}\right) = -\text{ln}(x) + C.
$$
</s>