# How to "prepare" expression for Taylor expansion

I find myself regularly in a situation where I have an expression like $$\frac{m^2+M^2}{(m^2-M^2)^2}$$ with the assumption that $$M\gg m$$ and the need to expand it up to order $$\mathcal{O}(M^{-2})$$. By hand, I would first rearrange the terms in the expression such that they only depend on $$m/M$$ and then Taylor this new expression, substituting $$m/M\equiv z$$, using Series[...,{z,0,2}].

The problem is that I don't know how to use Mathematica to do the part with rearranging the expression to depend on $$m/M$$ only. I of course tried

Series[(m^2+M^2)/(m^2-M^2)^2,{m/M,0,2}]


but I get an error saying that $$m/M$$ is not a variable.

• Sito. I notice this question has only been open 30 mins and already an answer has been accepted. You’re better apt to get a nice selection of possible answers if you defer accepting for a day or so. I’ll provide an answer which I feel is more tractable than Ulrich’s, though his answer seems to do mathematically what you want, I am always wary of using /. to do manually what can be don’t automatically by the system. Mar 4 at 14:37
• @CATrevillian fair enough. Looking fotward to what you come up with!
– Sito
Mar 4 at 14:52

Both options give the expected result same result as Ulrich shows with their method, however, it can be seen that this is not to the second order that OP indicates they desire expanding to.

Normal[Series[(m^2+M^2)/(m^2-M^2)^2,{M,Infinity,4}]]

Normal[(m^2+M^2)/(m^2-M^2)^2+O[M,Infinity]^5]


3 m^2/M^4 + 1/M^2

You’ll notice both are expanded to the fifth order, this is where the 1/M^4 appears.

What is happening here is that both inputs have the same output in the form of a SeriesData object. Normal is used to strip this off and produce a non-SeriesData object. In this case, this appears to the user as a removal of the +O[1/M]^5 part of the returned expression. This is commonly called “big O” and is the same as what it represents in mathematics, this being terms of the noted order and higher. This is mentioned as being “contagious” in the documentation, which means that without removing it via Normal, the surrounding functions will be expanded as well, and a SeriesData object will again be returned.

OP explicitly mentions they want to expand to order O[M]^-2 about the zero, which, in the framework of Mathematica and the Wolfram Language, is not directly possible. Instead, one must understand that when they want to expand to such terms of the form O[x]^-n or O[1/x]^n about the zero, that this is, equivalently, an expansion to a term O[x,Infinity]^n where the use of Infinity indicates an expansion about Infinity, meaning that the term 1/x becomes a small term about which the expansion is performed.

To expand to the order OP requests is done as follows:

Normal[Series[(m^2+M^2)/(m^2-M^2)^2,{M,Infinity,2}]]
Normal[(m^2+M^2)/(m^2-M^2)^2+O[M,Infinity]^3]


1/M^2

• Would you mind giving a short explanation on what your code exactly does?
– Sito
Mar 5 at 11:03
• @Sito sure! I’ll write up an explanative edit to the post in a few hours. Mar 5 at 13:50
• @Sito I have edited my answer. Please let me know if this is not sufficient explanation & how it may be improved. Mar 7 at 6:35

Try

Normal[Series[(m^2 + M^2)/(m^2 - M^2)^2 /. m -> eps M , {eps, 0,3}] ] /. eps -> m/M
(*(3 m^2)/M^4 + 1/M^2*)

• I see, nice trick!
– Sito
Mar 4 at 14:21