New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Series expansion of the square root gives wrong result #11407
Labels
Easy to Fix
This is a good issue for new contributors. Feel free to work on this if no one else has already.
series
Comments
astholkohtz
changed the title
series expansion of the square root gives wrong result
Series expansion of the square root gives wrong result
Jul 18, 2016
skirpichev
added a commit
to skirpichev/diofant
that referenced
this issue
Jul 19, 2016
skirpichev
added a commit
to skirpichev/diofant
that referenced
this issue
Jul 22, 2016
It seems that SymPy comes out with an unnecessarily complicated form: In [56]: sqrt(a+b+c*x).series(x, 0, 1)
Out[56]:
_______ 2 _______ 3 _______ _______ 2 _______
5⋅╲╱ a + b 15⋅b 5⋅b ⋅╲╱ a + b b ⋅╲╱ a + b 15⋅a 5⋅a⋅b⋅╲╱ a + b 3⋅a⋅b ⋅╲╱ a + b
─────────── + ──────────── - ──────────────────── + ────────────────────────────── + ──────────── - ─────────────────── + ────────────────────────────── - ─
16 _______ ⎛ 2 2⎞ ⎛ 3 2 2 3⎞ _______ ⎛ 2 2⎞ ⎛ 3 2 2 3⎞
16⋅╲╱ a + b 16⋅⎝a + 2⋅a⋅b + b ⎠ 16⋅⎝a + 3⋅a ⋅b + 3⋅a⋅b + b ⎠ 16⋅╲╱ a + b 8⋅⎝a + 2⋅a⋅b + b ⎠ 16⋅⎝a + 3⋅a ⋅b + 3⋅a⋅b + b ⎠ 1
2 _______ 2 _______ 3 _______
5⋅a ⋅╲╱ a + b 3⋅a ⋅b⋅╲╱ a + b a ⋅╲╱ a + b
─────────────────── + ────────────────────────────── + ────────────────────────────── + O(x)
⎛ 2 2⎞ ⎛ 3 2 2 3⎞ ⎛ 3 2 2 3⎞
6⋅⎝a + 2⋅a⋅b + b ⎠ 16⋅⎝a + 3⋅a ⋅b + 3⋅a⋅b + b ⎠ 16⋅⎝a + 3⋅a ⋅b + 3⋅a⋅b + b ⎠
In [57]: simplify(_)
Out[57]:
3 2 2 3
b + 3⋅a⋅b + 3⋅a ⋅b + a + O(x)
────────────────────────────────
_______ ⎛ 2 2⎞
╲╱ a + b ⋅⎝a + 2⋅a⋅b + b ⎠
In [58]: factor(_)
Out[58]:
3 2 2 3
b + 3⋅a⋅b + 3⋅a ⋅b + a + O(x)
────────────────────────────────
5/2
(a + b) The numerator there is |
On the current master:
This issue seems resolved and thus, only requires a test in order to close. |
sachin-4099
added
the
Easy to Fix
This is a good issue for new contributors. Feel free to work on this if no one else has already.
label
Jun 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Easy to Fix
This is a good issue for new contributors. Feel free to work on this if no one else has already.
series
Whenever the constant term on the square root is a sum of 2 or more symbols, the series() function gets the expansion wrong
As long as the constant term is only one, series() gives the correct result
The text was updated successfully, but these errors were encountered: