Mathematica [Mathematica] Sorting polynomial terms

AI Thread Summary
The discussion centers on sorting a mathematical series in increasing powers of the exponent. The user initially provides a code snippet that generates a series expansion using Mathematica but finds the output not in the desired order. The response suggests expanding the series around infinity, which aligns with the user's goal of representing the function outside the unit circle. The user confirms that using TraditionalForm in Mathematica achieves the desired format for the series. Overall, the conversation highlights the importance of the series expansion method and formatting in achieving the correct order of terms.
jackmell
Messages
1,806
Reaction score
54
Hi. Can someone explain to me how to sort a Series so that the terms are in increasing powers of the exponent? For example the code:

myseries = Normal[ Series[Sqrt[1 - w], {w, 0, 5}]] /. w -> 1/z

produces
1-\frac{7}{256 z^5}-\frac{5}{128 z^4}-\frac{1}{16 z^3}-\frac{1}{8 z^2}-\frac{1}{2 z}

I would like them to be

1-\frac{1}{2z}-\frac{1}{8z^2}-\cdots

Thanks,
Jack
 
Physics news on Phys.org
You can make a series around \infty. I don't know if that will appear sorted the way you want.
 
Sorry. I'm afraid I'm having some problems with this. The series is being reported by Mathematica in increasing powers of 1/z like it should and like I'd want it to be.

Thanks Hurky for suggesting expanding it around infinity which is what I'd want for the function outside the unit circle.
 
Last edited:
myseries = Normal[Series[Sqrt[1 - w], {w, 0, 5}]] /. w -> 1/z;
TraditionalForm[myseries]
 
Series[Sqrt[1 - w] /. w -> 1/z, {z, \[Infinity], 5}]
 
Ok, thanks guys. TraditionalForm does what I wanted.
 

Similar threads

Back
Top