1
$\begingroup$

I'm trying to expand an expression with some small parameters by using Series. It get stuck. Here's a simple example:

Series[x^(10^-6)/(1 - x)^(10^-6), x -> 0]

Series works for both x^(10^-6) and 1/(1 - x)^(10^-6), but not the product of them. Is there any trick to solve this problem? Thanks.

In principle, I can implement the algorithm of series expansion manually. For example

Series2[exp_Times, x___]:=Series[#,x]&/@exp; ...

But it is expected that the efficiency can not be comparable with the built-in function.

Also, the version of MMA I'm using is "12.2.0 for Linux x86 (64-bit) (December 3, 2020)."

$\endgroup$
8
  • $\begingroup$ I am slightly confused about what you want, so please correct me. Usually, I would expect that to find series one would do Series[expr, {x,0,10}] (find series of expr around $x= 0$ with 10 terms). Instead what you are doing seems to be more of the form Limit[expr,x->0]. You sure want series and not limit right? $\endgroup$ Commented Mar 24 at 4:56
  • $\begingroup$ @ Erosannin Thanks. In fact, I need to expand the expression to the leading order in x. In this case, the second argument should be x->0. Also, Sereis gets stuck when I use Series[exp, {x, 0, 0}]. $\endgroup$ Commented Mar 24 at 5:00
  • $\begingroup$ Think of Series[x^a/(1 - x)^a, x -> 0] $\endgroup$ Commented Mar 24 at 9:01
  • $\begingroup$ @ Cesareo Thanks. Symbolic expansion indeed works. But the expression I'm working with is too complicated and I need to expand it to a very high order, symbolic expansion would be too slow. $\endgroup$ Commented Mar 24 at 9:12
  • 1
    $\begingroup$ Not an answer to the question itself, but apparently this speed issue was addressed in more recent versions (as of 13.3 I believe).n = 6; Series[x^(10^-n)/(1 - x)^(10^-n), x -> 0] // Timing {0.020904, SeriesData[x, 0, {1}, 1, 1000001, 1000000]} $\endgroup$ Commented Mar 24 at 15:38

1 Answer 1

1
$\begingroup$

You can extract out the numerator, x^(10^-6), do the series expansion and then multiply it back to the expansion.

x^(10^-6) Normal[Series[1/(1 - x)^(10^-6), {x, 0, 5}]] // Expand 

This is the simplest thing that comes to my mind.

Update: Based on the comment and my understanding of the same. Let us consider a more complicated statement

expr = (x^(1/10^6) ((1 + 2 x) (1 + 5/3 x))^(1/10^6))/((1 - x)^(1/ 10^6) ((1 + x) (1 - 4/5 x))^(1/10^6)); 

Then I can for a list of expressions and denominators and do individual series expansion and then take the product of all

numlist = List @@ (Numerator[expr]); denolist = ( List @@ (Denominator[expr]))^-1; Expand[Times @@ (Normal[Series[#, {x, 0, 2}]] & /@ numlist) Times @@ (Normal[Series[#, {x, 0, 2}]] & /@ denolist)] 

It is instant ($\sim 0.003s$) for me for order 20 ( can reach higher orders as well).

$\endgroup$
3
  • $\begingroup$ Indeed, this works for the shown example, but the real expression I'm working with is far more complicated. $\endgroup$ Commented Mar 24 at 6:28
  • 1
    $\begingroup$ Without its knowledge, I cannot really help further, sorry. But you can always do what I did i.e., expand each component and multiply each expansion to get the full expansion. Maybe if you can construct a better minimal example I could help you with an updated answer. $\endgroup$ Commented Mar 24 at 7:38
  • $\begingroup$ Thanks. In fact, implementing the algorithm of series expansion is not a big problem. I'm more seeking a method of changing some built-in parameters or operations. $\endgroup$ Commented Mar 26 at 6:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.