# Drop higher-order terms in expansion-like expressions

I am dealing with expressions that are of the kind

Expr1 = (1 - c^2) (1 + D12 s1 + D13 s2)


and

Expr2 = (1 + c D13) (1 + c s1) + Sqrt[1 - c^2] D14 (c + s1) Sin[d]
+ (1 - c^2) D12 s2 Sin[d]^2 + Cos[d] (Sqrt[1 - c^2] (c D12 + D12 s1 + c s2 + D13 s2)
- (1 - c^2) D14 s2 Sin[d])


which are basically 0 (or 1) plus a number of corrections terms, where c is close to 1 (approximately 0.99), s1 is about ±0.2, and s2, D12, D13, and D14 are about ±0.01.

I am looking for a way to drop all crossed correction terms that are much smaller than a certain cutoff. For a cutoff of, say, ±0.001, this should drop terms such as (1 - c^2) D12 s2 or Sqrt[1 - c^2] D14 s1, but has to keep correction terms like c D13 and c s1. For the above examples, this should result in

Expr1new = 1 - c^2


and

Expr2new = (1 + c D13) (1 + c s1) + Sqrt[1 - c^2] D14 c Sin[d] + Cos[d] Sqrt[1 - c^2] c D12

• May 1, 2017 at 19:07

You may introduce a dummy variable and then do the Taylor series

   Expr1 = (1 - c^2) (1 + D12 s1 + D13 s2);
Expr2 = (1 + c D13) (1 + c s1) + Sqrt[1 - c^2] D14 (c + s1) Sin[d] + (1 - c^2) D12 s2 Sin[d]^2 + Cos[d] (Sqrt[
1 - c^2] (c D12 + D12 s1 + c s2 + D13 s2) - (1 -
c^2) D14 s2 Sin[d]);
rep\[Epsilon] = {s1 -> \[Epsilon] s1, s2 -> \[Epsilon]^2 s2, D12 -> \[Epsilon]^2 D12, D13 -> \[Epsilon]^2 D13, D14 -> \[Epsilon]^2 D14, (1 - c^2) -> \[Epsilon]^2 (1 - c^2)};
Normal[Series[Simplify[(Expr1 /. rep\[Epsilon]), {\[Epsilon] > 0}], {\[Epsilon],
0, 2}]] /. {\[Epsilon] -> 1}
Normal[Series[Simplify[(Expr2 /. rep\[Epsilon]), {\[Epsilon] > 0}], {\[Epsilon],
0, 3}]] /. {\[Epsilon] -> 1}


However, for the second expression this yields 1 + c D13 + c s1 + c^2 D13 s1 + c Sqrt[1 - c^2] D12 Cos[d] + c Sqrt[1 - c^2] s2 Cos[d] + c Sqrt[1 - c^2] D14 Sin[d], which differs by one term from what you expect. I think this extra term should be there.

• This works very nicely, thanks!
– Muk
Apr 10, 2017 at 8:58
• Do you have an idea how to expand the expressions if, for example, s1=0.2, which is "twice as large as Epsilon"? In this case, I want an expression like c^2 D12 s1 not to be dropped when expanded up to order Epsilon^2.
– Muk
Apr 10, 2017 at 11:09
• How about replacing s1 -> Sqrt[\[Epsilon]] s1 ?
– user46676
Apr 10, 2017 at 13:29
• Let me restate the problem. In terms like c^2 D12 s1, s1 and D12 are of order epsilon and epsilon^2, respectively. Expanding such term to order epsilon^2 will drop the term from the final expression. But I know numerically that s1 is approximately 0.2 or even larger, which translates to s1 not being of order epsilon but rather epsilon^k, with k < 1. If that makes sense. Hence, I want to keep terms like c^2 D12 s1. Do you know a way?
– Muk
Apr 10, 2017 at 14:46
• Well, I'd propose to introduce a fundamental expansion parameter, some new \[Epsilon], by requiring that s1 -> \[Epsilon] s1 and then s2 -> \[Epsilon]^3 s2 and so on. This reproduces s1 ~ 0.2 and s2 ~ 0.01. Of course, the powers depend on what you precisely have in mind.
– user46676
Apr 10, 2017 at 14:57

A simple way would be to consider eps ~ 0.1 and use expansions:

c   = c0 + eps^2 c2 + eps^3 c3;
s1  = eps^2 s11 + eps^3 s13;
s2  = eps^2 s22 + eps^3 s23;
D12 = eps^2 D122 + eps^3 D123;
D13 = eps^2 D132 + eps^3 D133;
D14 = eps^2 D142 + eps^3 D143;


Expr1 = (1 - c^2) (1 + D12 s1 + D13 s2);
Expr2 = (1 + c D13) (1 + c s1) + Sqrt[1 - c^2] D14 (c + s1) Sin[d]
+ (1 - c^2) D12 s2 Sin[d]^2 + Cos[d] (Sqrt[1 - c^2] (c D12 + D12 s1 + c s2 + D13 s2)
- (1 - c^2) D14 s2 Sin[d]);


The cutoff would be eps^3:

In[12]:= Normal@Series[Expr1, {eps,0,2}]

Out[12]:= 1 - c0^2 - 2 c0 c2 eps^2


which is (almost) what you want.

Again:

In[13]:= Normal@Series[Expr2, {eps, 0, 2}]
Out[13]:= 1 + eps^2 (c0 D132 + c0 s11 + c0 Sqrt[1 - c0^2] D122 Cos[d] +
c0 Sqrt[1 - c0^2] s22 Cos[d] + c0 Sqrt[1 - c0^2] D142 Sin[d])