I have this equation:$$y=2+\int_2^x (t-ty(t))dt$$
After solving it I got the answer $-\ln|1-y|=\frac {x^2} 2-2$ although the book has the same answer without the absolute value in the logarithm, why is this possible?
E:
Attempt:
$$y=2+\int_2^x (t-ty(t))dt \implies \frac {dy}{dx}=x-xy(x)=x(1-y(x))$$
$$\frac {dy}{1-y}=xdx \implies -ln|1-y|=\frac {x^2}2+c$$
The rationale for determining the unique solution is embedded in the general solution
$$-\log |1-y|=\frac12(x^2-4)\tag 1$$
Note that to arrive at $(1)$, we already imposed the condition $y(2)=2$. Therefore, we are seeking solutions for which $y$ actually attains the value of $y=2>1$.
To resolve this further, let's solve $(1)$ for $y(x)$, disregarding the requisite condition. We find that
$$y(x)= \begin{cases} 1+e^{-(x^2-4)/2},&y>1 \tag 2\\\\ 1-e^{-(x^2-4)/2},&y<1 \end{cases}$$
is multi-valued. Upon inspection, we see that for $x=2$, only the first equation of $(2)$ satisfies either the condition $y(2)=2$ or the initial integral equation. That is, by assumption, the second solution must have values less than $1$ and can therefore, never attain the value $2$.
Therefore, the unique solution to the integral equation is
$$y(x)=1+e^{-(x^2-4)/2}$$
for which $y>1$.
Finally, we can write the equivalent solution as
$$-\log(y-1)=\frac12x^2-2$$
without need for the absolute value sign.