# How to linearize an expression involving derivatives?

I want to linearize the expression involving function $y(x,t)$ $$[y^3(y_x-y_{xxx})]_x$$

by assuming $y(x,t)=y_0(t)+y\prime(x,t)$, where $y\prime(x,t)$ is a small variation. In other words, I will drop terms involving multiplication of the small quantity or the derivatives of small quantity.

I noted this helpful answer and came up with the following code

f[y_] = D[y^3*D[y - D[y, x, x], x], x];

((Series[f[y0[t] + \[Epsilon] dy[x, t]], {\[Epsilon], 0, 1}] //
Normal) /. \[Epsilon] -> 1) // FullSimplify


This code give zero. Obviously, there is something wrong here because the answer can be obtained easily by hand as follows

$$y_0^3(y_{xx}^\prime-y_{xxxx}^\prime)$$

However, for an expression without derivative this method works well, such as:

f[a1_, a2_] = a1^2 a2;
(Series[f[q1 + \[Epsilon] dq1, q2 + \[Epsilon] dq2], {\[Epsilon], 0, 1}] // Normal)/. \[Epsilon] -> 1
(* dq2 q1^2 + 2 dq1 q1 q2 + q1^2 q2 *)


Update:

With the concise answer from @Alexei Boulbitch, the original problem have been solved. This is an elegant method. In particular, it uses eps to indicated how many small variables have be multiplied in an individual term, then takes only the coefficient of eps, equlivant to expand upto first order. But it seems not a general method for linearization an expression. For example, the following simple fraction

$$f(m,n)=\frac{b-m}{a+n}$$

First, I used the original method including Series:

f[m_, n_]: = (b - m)/(a + n);
((Series[f[m0[t] + \[Epsilon] dm[x, t], n0[t] + \[Epsilon] dn[x, t]],
{\[Epsilon], 0, 1}] //Normal) /. \[Epsilon] -> 1) // FullSimplify
(*(-dm[x, t] (a + n0[t]) + (b - m0[t]) (a - dn[x, t] + n0[t]))/(a +
n0[t])^2*)


which gives the right linearization. As using @Alexei Boulbitch's method:

Lf = f[m0[t] + \[Epsilon] dm[x, t], n0[t] + \[Epsilon] dn[x, t]] //
Expand; Coefficient[Lf, \[Epsilon]] // FullSimplify
(*-(dm[x, t]/(a + \[Epsilon] dn[x, t] + n0[t]))*)


It is inaccurate answer. But what is wrong with the Expand method?

My question is how I can fix my code to obtain the correct answer? Thank you!

• Try using Dt[] instead of D[]. May 10, 2016 at 9:27
• @ J. M.♦ Thanks for your rapid response! Just try it with f[y_] = Dt[y^3*Dt[y - Dt[y, x, x], x], x] , which give a long and also wrong answer. Dt[ ] represent the total derivative but $f(x,t)$ is a function a two vars. Did I understand you, sorry if I made a silly mistake? May 10, 2016 at 9:34
• Have a look at the result of Collect[Dt[y^3 Dt[y - Dt[y, x, x], x], x], y]. Notice in particular the second term. Think about why the first term is the one that should be dropped. May 10, 2016 at 9:40
• @ J. M.♦ I noted that the second term of the Collect is actually the answer (after dropping the multiplication of small variables). I understand that the first term is a product of the derivatives of small vars so it should be dropped. However, I don't know how to drop it automatically... May 10, 2016 at 9:55

Try this:

    f[y_] := D[y^3*D[y - D[y, x, x], x], x];

g = f[y0[x] + eps*z[x]] // Expand;
Coefficient[g, eps]


It returns the following: Here z stays instead of your y'.

Have fun!

• @ Alexei Boulbitch, your method works well in this case. However, it seems to be kinda not general :) Please check my update. Thanks! May 12, 2016 at 3:08
• @can It is because you use it incorrectly. In simple function like in your second example, it is easier to take a partial derivative. In a more complex axample you in fact also calculate functional partial derivatives and, correspondingly, you need to use two independent parameters eps1 and eps2 for each of them. It is not a method I invented. One can read about it in the book: Smirnov, V. I. A Course of Higher Mathematics. 16 edn, Vol. 4 (Pergamon Press, 1964). It is the volume about variational analysis. Volume 4, I guess. May 12, 2016 at 8:03
• @can Look, if you have a simple function, like f[m,n] in your second example, the task is trivial. Series works, you may simply calculate a partial derivative, and it also works, and there are still few other working approaches. I would not spend time answering such a trivial question. A somewhat less trivial situation arises in the case of a functional expression including the one with derivatives, such as, for instance, that in your first example. In that case also I know also at least two methods of doing this, but, probably, there are more approaches. May 12, 2016 at 12:12
• @can Continuation, The point is that one should not think that there is a universal method valid for everything, but should apply to each problem the approach best suited for it. Have fun! May 12, 2016 at 12:13