# 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 equations must involve $y, y', y''$ etc. with coefficients that are (at worst) functions of $x$. terms like $yy'$ or $y^2$ are ruled out Commented Jun 8, 2013 at 10:10
• If the ODE has the unknown function and/or its derivative(s) as an argument of a trigonometric, hyperbolic trigonometric, exponential, logarithmic, and/or n-th root function, the ODE is non-linear. If the ODE has a product of the unknown function times any of its derivatives, the ODE is non-linear. If the ODE has the unknown function and/or its derivative(s) with power greater than 1, the ODE is non-linear. Commented Feb 2, 2022 at 5:46

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)$).

• does this mean that linear differential equation has one y, and non-linear has two y, y'? Commented Jun 21, 2017 at 8:28
• @Daniel Robert-Nicoud does the same thing apply for linear PDE? Wikipedia says PDE is linear if it is linear in dependent variable and its derivatives. Commented Nov 20, 2018 at 20:20
• @ramanujan Yes, it does. Commented Nov 20, 2018 at 21:55
• This reduction is not clear to me. Why we can not use $y' + 1 \to L$? Commented Apr 18, 2023 at 14:29

If the equation would have had $\ln (y)$ on the right, that also would have made it non-linear, since natural logs are non-linear functions. Remember that this has its roots in linear algebra: $y=mx+b$. You can analyse functions term-by-term to determine if they are linear, if that helps. The first time a term is non-linear, then the entire equation is non-linear.

Remember that the $x$s can pretty much do or appear however they want, since they're independent. Which means if you can't tell just by glancing, try to group all your $y$ terms to one side and then analyse them. Makes it much easier.

See, I was also overthinking this, but realised you have to go back to those definitions we're given.

Two criteria for linearity:

1. The dependent variable y and its derivatives are of first degree; the power of each y is 1. $\frac{dy}{dx}$; yes. $(\frac{dy}{dx})^4$, no.

2. Each coefficient depends only on the independent variable $x$.

$yy'$ makes it nonlinear as has been said, because that coefficient on $y'$ is not in $x$. Had that coefficient been a constant, you would have been correct to call it linear, since constants can be functions of $x$. Like, $f(3)=x$. Its graph is a line, i.e. linear function.

Always go back to the definitions. :-)

• I have edited your answer for better readability. For some basic information about writing math at this site see e.g. here, here, here and here. Commented Nov 13, 2015 at 4:04

One could define a linear differential equation as one in which linear combinations of its solutions are also solutions.

• your statement is true for only homogeneous LDE? For nonhomogeneous it is false. And I think it is also false in PDE. Commented Nov 20, 2018 at 20:16
• @ramanujan What is an example of a non-homogeneous LDE or PDE whose solutions' linear combinations are also solutions? Commented Nov 20, 2018 at 22:29
• (do you mean 'solution of linear combinations are not solutions?') Simplest example is $y^{\prime}= 2$ and take both solutions $y=2 x$. Commented Nov 21, 2018 at 4:21
• @ramanujan $y'=2$ is non-homogeneous? Commented Nov 21, 2018 at 4:37
• Cited sources says first order LDE is nonhomogeneous if $y^{\prime} + p(x)y = q(x)$, if $q(x)$ is not identically zero. here and here Commented Nov 21, 2018 at 7:38

Linear Differential equations are those in which the dependent variable and its derivatives appear only in first degree and not multiplied together

• $y'''+y''+y=e^x$ is linear ;) The degree is irrelevant. What's important is "not multiplied together" Commented Aug 28, 2016 at 6:21

Let's just use the definition to answer the question, but with simplified notation (risking a bit of impreciseness for clearer understanding).

We are thinking of y as a function of x and asking whether a certain equation involving that function and some of its derivatives is a linear one. Those derivatives are y', y'', etc.

There will be certain coefficient functions that we will call a(x), b(x), etc. (instead of the more usual a1(x), a2(x), etc.)

A differential equation is linear if and only if it is in the following form or is mathematically equivalent to said form:

a(x)*y + b(x)*y' + c(x)*y'' + ... = q(x)

(Right side is just a loose function of x.)

Example: sin(x)y'' + xy = 3x is linear, with c(x)=sin(x), b(x)=0, a(x)=x, and q(x)=3*x.

Non-Example: sin(xy) + y'' = x is non-linear, owing to the sin(xy) term, which does not fit the definitional form.

Example: (e^x)*y'' + (1/x)*y' - 3x = 0 is linear.

Non-Example: x*y'' + (1/x)*y = 3x(e^y) is nonlinear, with the only problem being the e^y (on the right).

Hope this helps!

Because highest order derivative is multiplied with dependent variable $y$. Like $y y'$.