Bug introduced after 9 and persisting through 13.1. Resolved in 13.2
Recently, I have found a very bad problem with Wolfram Language. It gives the wrong answer for a quite simple expression!
When calculating
Series[ArcTan[A + 1/x], {x, 0, 2}, Assumptions -> A > 0 && x > 0]
I get the wrong answer (tested in wolfram cloud and in Mathematica 12.1.1.0)
I am absolutely sure that the correct answer should be
There is a plot of these functions to demonstrate the issue
How to get rid of the problem?
UPD More obvious issue (thank to @MichaelE2):
UPD#2 Working around.
The result in v10.3 is correct.
The result in v11.3 is incorrect.
The corresponding post is in Wolfram Community.
n=2
,Series[Series[ArcTan[A + 1/x], {x, 0, 2 n}, Assumptions -> A > 0 && x > 0], {x, 0, n}]
. Seems to work and be necessary for highern
. -- I'd say it's a bug and you should report it to WRI. $\endgroup$A
constant andx
variable. However, in your plot,x
is constant andA
variable. You can not this purely graphically, the slope for A==0 should be negative not positive. When you plotx
as a variable, the plot looks much better. $\endgroup$In[291]:= Series[ArcTan[aa + x], {x, Infinity, 2}, Assumptions -> aa > 0 && x > 1000] Out[291]= SeriesData[x, DirectedInfinity[1], {Rational[1, 2] Pi, -1, aa}, 0, 3, 1]
$\endgroup$x
, you should try to show the series isO[x]^3
. It's clearly not, but the OP's "correct answer" is:Block[{ A = 2, f = (ArcTan[ A + 1/x] - {Normal@ Series[ArcTan[A + 1/x], {x, 0, 2}, Assumptions -> A > 0 && x > 0], \[Pi]/2 - x + A x^2})/x^3}, Plot[f, {x, 0, 1}, WorkingPrecision -> 16] ]
$\endgroup$