Linear and non-linear function Linear function - A differential equation is said to be linear if the unknown function and it's derivative, which occur in the equation, occur only in the first degree and are not multiplied together.
I have some doubts related to above definition.
1.) If we have differential equations then which term is treated as unknown function. 
2.) Derivative here means single derivative or highest derivative.
For example if we have following equation -
$t^2\frac{d^2s}{dt^2}-st(\frac{ds}{dt})^4=s$
So which one is unknown function and which one is treated as it's derivative double derivative or single?

And what about this one $\frac{d^2y}{dx^2}=\cos3x+\sin3x$

 A: If you have $\frac{dy}{dx} = \dots$, then $y$ is your "unknown function" and $x$ is your variable. By "derivative" they mean any order derivative. An ODE being linear means if we put all the $y$, $y'$, everything with a $y$ on one side and everything with an $x$ on the other, we should be able to factor out the operator on $y$.
Example:
$$ 4\frac{d^2y}{dx^{2}} - \sin(x)\frac{dy}{dx} + 5y = x^{3}\exp(x) $$
is linear. It's because we can write it as the following: 
$$ \bigg(4\frac{d^{2}}{dx^{2}} - \sin(x)\frac{d}{dx} + 5\bigg) y = x^{3}\exp(x). $$
What is inside the parenthesis is called an operator, call it $L$. So it's like 
$$ L(y) = f(x). $$
Operators like this operate on functions, rather than variables like $y(x)$ does. And operators are linear if $L(ay_{1}+y_{2}) = aL(y_{1}) + L(y_{2})$ for constants $a$ and functions $y_{1}$ and $y_{2}$.
If you cannot write such an ODE in this way, it is not linear. So things like $\exp(y)$ or $\Big(\frac{d^2y}{dx^{2}}\Big)^3$ or $cos\Big(\frac{dy}{dx}\Big)$ or $(x+y)^2$. Anything like this will not be linear.
A: Derek's answer has already explained a lot. In fact, most of the times one can say whether a differential equation is linear or nonlinear at the first glance. But if you want an algorithmic approach, here are the steps that I could come up with:


*

*Determine which letters represent the independent variable(s) and which one is the function. For example, in
$$t\ddot{y}-2y'+t^2xy = \ln(x)$$
where $y'$ represents ${dy}/{dx}$ and $\dot{y}$ is ${dy}/{dt}$, it is evident that $t$ and $x$ are independent variables and $y$ is the function. (yes, it's a PDE with poor notations)

*Let's assume the dependent variable (i.e. function) is represented by $y$. Try to group all your $y$-terms to one side and then analyze them. By $y$-terms I mean all the terms that contain $y$ or its derivatives. In the example above, this is already done in the left side.

*In a linear equation, the dependent variable $y$ and its derivatives must be of first degree. Here degree means power. For example, $y$ and $y''$ are of first degree, while $\left(\frac{dy}{dx}\right)^2$ is not. So if you see any term that $y$ or its derivatives had power greater than one, then the equation is nonlinear.

*In a linear equation, for any term that contains $y$, the coefficient must depend only on the independent variable. For example, in $t^2y'$ the coefficient, $t^2$ only depends on $t$. So it's a linear term. While in $yy'$ you can take $y$ or $y'$ as the coefficient and in both cases it is dependent on $y$, so it's a nonlinear term.

*And finally note that in a linear equation, all terms are linear.


Some ideas are taken from this post.
