Series expansion gives incorrect result

Bug introduced after 10.4 and persisting through 11.3.0

Mathematica 11.1.1.0 tells me that

In: Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/
(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, Infinity, 0}]
Out: 1 + O[1/x]^1

instead of the correct answer $$\lim_{x\rightarrow\infty}\frac{x-\sqrt{1+x^2|a|^2}}{x+\sqrt{1+x^2|a|^2}}=\frac{1-|a|}{1+|a|}.$$

I can get the right answer if I replace a*Conjugate[a] by Abs[a]^2 but that should not make a difference. Replacing a*Conjugate[a] by a^2 still gives the wrong answer.

Q: Is this a known/predictable issue with Series and how can I avoid this? (Using Limit instead of Series is one suggested work around.)

• What's the actual question here? Nevertheless: Limit[expr, x -> Infinity] // FullSimplify // Together gives the desired output. – corey979 Jan 10 '18 at 9:57
• Looks like a bug to me, because in v10.4 Series[expr, {x, Infinity, 0}] // Normal // FullSimplify // Together gives the correct output, but v11.1 indeed gives 1. Someone else could check if it's the case in v11.2. I'm adding the bugs tag. – corey979 Jan 10 '18 at 10:19
• v11.2 returns 1 + a Conjugate[a] + O[1/x]. – QuantumDot Jan 10 '18 at 15:15
• There is no Mathematica v10.5 – QuantumDot Mar 14 '18 at 22:17
• thank you, I stand corrected. – Carlo Beenakker Mar 14 '18 at 22:23

At first I thought the issue was that there wasn't an assumption built in that says $a\,\bar a$ is a nonnegative real.

Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, ∞, 0},
Assumptions -> a*Conjugate[a] >= 0]

(* SeriesData[x, DirectedInfinity, {(1 - Abs[a])/(1 + Abs[a])}, 0, 1, 1] *)

But after further investigation, it seems the proper way to view the issue is that the assumption that x is positive is probably not made at some critical point:

Series[
(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]),
{x, Infinity, 0}, Assumptions -> x > 0]
(*
SeriesData[x, DirectedInfinity,
{(1 - (a Conjugate[a])^Rational[1, 2])/(1 + (a Conjugate[a])^Rational[1, 2])},
0, 1, 1]
*)

Note that the following is a simpler example with the same bug:

Series[(x - Sqrt[1 + x^2*z])/(x + Sqrt[1 + x^2*z]), {x, Infinity, 0}]
(*  SeriesData[x, DirectedInfinity, {1 + z}, 0, 1, 1]  (wrong) *)

Limit[(x - Sqrt[1 + x^2*z])/(x + Sqrt[1 + x^2*z]), x -> Infinity]
(*  (1 - Sqrt[z])/(1 + Sqrt[z])  *)
$Version (* 11.2.0 for Microsoft Windows (64-bit) (September 11, 2017)*) . Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, Infinity, 0}]//Normal (* 1 + a Conjugate[a] *) ? Adding assumptions: Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, Infinity, 0}, Assumptions -> {a != 0}] (* 1 + a Conjugate[a] *) ? . Adding Assumptions -> {a != 0} solved the problem in case if I replace a*Conjugate[a] by Abs[a]^2. Series[(x - Sqrt[1 + x^2*Abs[a]^2])/(x + Sqrt[1 + x^2*Abs[a]^2]), {x, Infinity, 0}, Assumptions -> {a != 0}] $$\frac{1-\left| a\right| }{1+\left| a\right| }+O\left(\left(\frac{1}{x}\right)^1\right)$$ In Mathematica 10.2 gives: Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, Infinity, 0}] // Normal // FullSimplify // Together$\frac{1-\left| a\right| }{1+\left| a\right| }$With Assumptions: Series[(x - Sqrt[1 + x^2*a*Conjugate[a]])/(x + Sqrt[1 + x^2*a*Conjugate[a]]), {x, Infinity, 0}, Assumptions -> a != 0] // Normal // FullSimplify // Together$\frac{1-\left| a\right| }{1+\left| a\right| }$• Did the first command really give 1 + a Conjugate[a]? This looks weird. – corey979 Jan 10 '18 at 11:39 • @corey979 Yes did. – Mariusz Iwaniuk Jan 10 '18 at 12:01 • I mean that the$1+aa^*\$ result is not very similar to the outputs of v10.2/10.4/11.1; looks like things went really bad in v11... – corey979 Jan 10 '18 at 12:16