# Construct approximation by eliminating algebraic terms of small magnitude

Let's suppose that for the following expression:

$\qquad \alpha\,\beta +\alpha+\beta$

I know that $\alpha$ and $\beta$ are of small magnitude (e.g., 0 < $\alpha$ < 0.02 and 0 < $\beta$ < 0.02). Therefore, the magnitude of $\alpha\,\beta$ is negligible, i.e., the original expression can be approximated by

$\qquad \alpha+\beta$

Is there any command in Mathematica to do such an operation?

Reminder from original question: if and $\alpha$ and $\beta$ are of small magnitude, we may approximate the original equation by disregarding nonlinear terms, such as $\alpha^n$, $\beta^n$,n=2,3,..., and $\alpha\beta$

My observation is that by applying the good code suggestion of @Henrik Schumacher in a fraction it seems to not generate a proper result to the whole fraction. For instance,if

$\text{numerator}=\alpha \beta +\alpha +\beta ^2+\beta -\lambda \epsilon q(t)+\text{$\beta $q}(t)$

numerator = α*β + β^2 + α + β + β q[t] - ϵ*λ*q[t]

f = numerator;
(f /. {α -> 0, β -> 0}) + (D[f, {{α, β}, 1}] /. {α -> 0, β -> 0}) . {α, β}


The code generates the correct elimination on numerator :$\alpha +\beta -\lambda \epsilon q(t)+\text{$\beta $q}(t)$

and

$\text{denominator}=\alpha +\alpha (-\beta ) \text{LD}(t)+\alpha \beta q(t)+\beta q(t)+\epsilon +1$:

denominator= 1  +α  +ϵ   -α*β*LD[t]   +β*q[t]   +α*β*q[t]

f = denominator;
(f /. {α -> 0, β -> 0}) + (D[f, {{α, β}, 1}] /. {α -> 0, β -> 0}) . {α, β}


The code generates the correct elimination on denominator: $\alpha +\beta q(t)+\epsilon +1$

Nevertheless, when applying the suggested first order Taylor Series expansion in the fraction as a whole:

f = (numerator /denominator);
(f /. {α -> 0, β -> 0}) + (D[
f, {{α, β}, 1}] /. {α -> 0, β ->
0}).{α, β} // Simplify


The result generated is incorrect. $\frac{(\epsilon +1) (\alpha +\beta )-q(t) (\lambda \epsilon (-\alpha +\epsilon +1)+\beta \text{$\beta $q}(t))+\beta \lambda \epsilon q(t)^2+(-\alpha +\epsilon +1) \text{$\beta $q}(t)}{(\epsilon +1)^2}$

That can be observed by, for instant, noticing that in the output above (i) the numerator has $\beta^2$, (ii) the code generated $q[t]^2$ that did not exist in the original equation.

I hope that this time I could express my concern in a proper format. Thank you all for your support!

Questions related to @Akku14's code suggestion

Question 1: @Akku14, I was trying to use your code suggestion with the slight modification in the original purpose(instead of eliminating α and β, now eliminating α, β and LD[t]), but I had no success. I think the reason is because I could not find a way of writing LD[t] as a parameter of function g:

for the following equation:

\[CapitalDelta]p[t] = (α*β + β^2 + α + β + β*q[t] - ϵ*λ*q[t])/(1 + α + ϵ -α*LD[t] + β*q[t] + α*β*q[t])


$\text{$\Delta $p}(t)=\frac{\alpha \beta +\alpha +\beta ^2+\beta +\beta q(t)-\lambda \epsilon q(t)}{\alpha +\alpha (-\text{LD}(t))+\alpha \beta q(t)+\beta q(t)+\epsilon +1}$

g[α_, β_, LD[t] _] = \[CapitalDelta]p[t]


By using @Akku14's suggestion:

ser = (Series[g[α eps, β eps, LD[t] eps], {eps, 0, 1}] //
Normal) /. eps -> 1 // Simplify


I get the following output:

$\frac{(\epsilon +1) (\alpha +\beta )+q(t) (\lambda \epsilon (\alpha -\epsilon -1)+\beta (\epsilon +1)-\alpha \lambda \epsilon LD[t]+\beta \lambda \epsilon q(t)^2}{(\epsilon +1)^2}$

which is incorrect since $\alpha \lambda \epsilon LD[t]$ is present in the numerator of ser.

Again, I think that the problem is that my g is not recognizing LD[t] as a parameter; would any of you know how to approach this issue?

Question 2.1: in case I wanted second order Taylor Series for g[α, β, LD[t]], changing {eps, 0, 1} to {eps, 0, 2} at ser would be enough to get the correct result? Like:

ser = (Series[g[α eps, β eps, LD[t] eps], {eps, 0, 2}] //
Normal) /. eps -> 1 // Simplify


Question 2.2: in case I wanted n order Taylor Series for g[α, β, LD[t]], changing {eps, 0, 1} to {eps, 0, n} at ser would be enough to get the correct result?

• – Daniel Lichtblau May 13 '18 at 21:23
• Please post actual code, something that can be cut-and-pasted. – Daniel Lichtblau May 14 '18 at 23:05
• There is a space missing between β and q[t] in the definition of the numerator. Inserting it should fix everything. – Henrik Schumacher May 15 '18 at 7:29
• Btw.: That was one of the reasons to ask for a copy of the precise code you used. – Henrik Schumacher May 15 '18 at 8:20
• Dear @HenrikSchumacher, thank you for point that out, but unfortunately even after fixing $\beta$q[t] to $\beta *q[t]$ it still generate incorrect results. – Lucas Santana May 16 '18 at 14:38

Let me give a slightly different form, that is - as far as I see quickly - equivalent to that of Henrik Schumacher, and show, why there appears a q[t]^2 term.

f[a_, b_] := a b + a + b


Take series for small eps, and fix the result with eps->1

(Series[f[a eps, b eps], {eps, 0, 1}] // Normal) /. eps -> 1

(*   a + b   *)


Higher orders give the original function

(Series[f[a eps, b eps], {eps, 0, 5}] // Normal) /. eps -> 1

(*   a + b + a b   *)


Now the rational function

numerator[a_, b_] :=
a*b + b^2 + a + b + b q[t] - \[Epsilon]*\[Lambda]*q[t]

denominator[a_, b_] :=
1 + a + \[Epsilon] - a*b*LD[t] + b*q[t] + a*b*q[t]

ser0 = (Series[
numerator[a eps, b eps]/denominator[a eps, b eps], {eps, 0,
1}] // Normal) /. eps -> 1 // Together

(*   (1/((1 + \[Epsilon])^2))(a + b + a \[Epsilon] + b \[Epsilon] +
b q[t] + b \[Epsilon] q[t] - \[Epsilon] \[Lambda] q[t] +
a \[Epsilon] \[Lambda] q[t] - \[Epsilon]^2 \[Lambda] q[t] +
b \[Epsilon] \[Lambda] q[t]^2)   *)


Taking separate series

ser1 = (Series[numerator[a eps, b eps], {eps, 0, 1}] // Normal) /.
eps -> 1 // Together

(*   a + b + b q[t] - \[Epsilon] \[Lambda] q[t]   *)

ser2 = (Series[denominator[a eps, b eps], {eps, 0, 1}] // Normal) /.
eps -> 1 // Together

(*   1 + a + \[Epsilon] + b q[t]   *)


Although ser1/ser2 has no q[t]^2 term, it has a term q[t]/(1 + b q[t]) which yields a q[t]^2 term with small b

(Series[q[t]/(1 + b q[t]) /. {a -> a eps, b -> b eps}, {eps, 0, 1}] //
Normal) /. eps -> 1

(*   q[t] - b q[t]^2   *)


Therefore further series ser3 has to be done, that yields the same result as ser0

ser3 = (Series[ser1/ser2 /. {a -> a eps, b -> b eps}, {eps, 0, 1}] //
Normal) /. eps -> 1 // Together

(*   (1/((1 + \[Epsilon])^2))(a + b + a \[Epsilon] + b \[Epsilon] +
b q[t] + b \[Epsilon] q[t] - \[Epsilon] \[Lambda] q[t] +
a \[Epsilon] \[Lambda] q[t] - \[Epsilon]^2 \[Lambda] q[t] +
b \[Epsilon] \[Lambda] q[t]^2)   *)

ser3 == ser0

(*   True   *)

• Thanks @Akku14, I will soon check your suggestion. – Lucas Santana May 16 '18 at 14:42

You could use first order Taylor expansion, e.g. with

f = α β + α + β;
(f /. {α -> 0, β -> 0}) + (D[f, {{α, β}, 1}] /. {α -> 0, β ->0}).{α, β}


$\alpha +\beta$

For your second example (with typos fixed), I obtain

numerator = α β + β^2 + α + β + β q[t] - ϵ λ q[t];
denominator = 1 + α + ϵ - α β LD[t] + β q[t] + α β q[t];
f = numerator/denominator;
(f /. {α -> 0, β -> 0}) + (D[ f, {{α, β}, 1}] /. {α -> 0, β -> 0}).{α, β}


$$\alpha \left(\frac{\lambda \epsilon q(t)}{(\epsilon +1)^2}+\frac{1}{\epsilon +1}\right)+\beta \left(\frac{\lambda \epsilon q(t)^2}{(\epsilon +1)^2}+\frac{q(t)+1}{\epsilon +1}\right)-\frac{\lambda \epsilon q(t)}{\epsilon +1}$$

• Comments are not for extended discussion; this conversation has been moved to chat. – Kuba May 15 '18 at 5:48

I would follow the approach recommended by @Jens in the linked answer, which is similar to the answer by @Akku ( It is different since @Akku takes series of the numerator and denominator separately, and then finds the series of the ratio after normalizing). Introduce a dummy scaling variable, and then do a series expansion about the scaling variable:

r = Normal @ Series[numerator/denominator /. v : α|β -> s v, {s, 0, 1}] /. s->1


-ϵ λ q[t]/(1 + ϵ) + (α + β + α ϵ + β ϵ + β q[t] + β ϵ q[t] + α ϵ λ q[t] + β ϵ λ q[t]^2)/(1 + ϵ)^2

We can use Collect to get this into basically the same form as @Henrik's answer:

Collect[r, {α, β}, Apart] //TeXForm


$\alpha \left(\frac{\lambda \epsilon q(t)}{(\epsilon +1)^2}+\frac{1}{\epsilon +1}\right)+\beta \left(\frac{\lambda \epsilon q(t)^2}{(\epsilon +1)^2}+\frac{q(t)}{\epsilon +1}+\frac{1}{\epsilon +1}\right)-\frac{\lambda \epsilon q(t)}{\epsilon +1}$

This approach will scale much better for higher order expansions.

• to @Carl Woll. I take the series of the numerator and the denominator separately, only in order to show, how the term q[t]^2 arises, because Lucas Santana was astonished about that term. My ser0 is indeed the series expansion of the whole expression. – Akku14 May 17 '18 at 7:13