What makes a differential equation, linear or non-linear? [duplicate]

Among these differential equations why one is linear while other is non-linear?

What is criteria to find out whether a differential equation is linear or non-linear?

marked as duplicate by user99914, b00n heT, T. Bongers, Lee Mosher, Chill2MachtAug 3 '16 at 23:28

A differential equation is linear if there are no products of $y$ and its differentials.
For example, $y\cdot \frac{dy}{dx}=e^x$ would be non-linear, as well as $y^2+\frac{dy}{dx}=e^x$.
• @gansub It is not even a differential equation, so I edited it, but since $y^2=y \cdot y$, there are products of the unknown function and it differentials (which can be the unknown function itself). – wythagoras Jan 22 '17 at 17:59
Linear differential equations: They do not contain any powers of the unknown function or its derivatives (apart from 1). Your first equation falls under this. If this equation had something like $\frac{dy}{dx}^n$, $\frac{d^2y}{dx^2}^n$ where $n \neq 0 \ \text{or}\ 1$, this would make it non-linear.
Non-linear: may contain any powers of the unknown function or its derivatives (where power $> 0$) or even a product of unknown function and its derivatives. Your second equation is non-linear because it contains a power of the unknown function (in this case, $y(x)^2$)