Linear vs nonlinear differential equation How to distinguish linear differential equations from nonlinear ones?
I know, that e.g.:
$$
y''-2y = \ln(x)
$$
is linear, but
$$
3+ yy'= x - y
$$
is nonlinear.
Why?
Linear differential equations are those which can be reduced to the form $Ly = f$, where $L$ is some linear operator.

Your first case is indeed linear, since it can be written as:

$$\left(\frac{d^2}{dx^2} - 2\right)y = \ln(x)$$

While the second one is not. To see this first we regroup all $y$ to one side:

$$y(y'+1) = x - 3$$

then we simply notice that the operator $y\mapsto g(y) = y(y'+1)$ is not linear (for example we can take two functions $y_1$ and $y_2$ and notice that $g(y_1+y_2)\neq g(y_1) + g(y_2)$).
Because highest order derivative is multiplied with dependent variable $y$.
Like $y  y'$.