-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
manualintegrate sqrt(a+b*x+c*x**2) #23530
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
Conversation
✅ Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.11. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
19c5f87
to
309a3a3
Compare
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) before after ratio
[77f1d79c] [832c24fe]
<sympy-1.10.1^0>
+ 130±3ms 237±7ms 1.83 sum.TimeSum.time_doit
Full benchmark results can be found as artifacts in GitHub Actions |
Wolfram alpha gives a result without any integral https://www.wolframalpha.com/input?i=integrate+sqrt%28a%2Bb*x%2Bc*x**2%29+dx Other than that, the presented derivation seems correct to me and the changes in the code make sense, although I am not too familiar with manualintegrate`. |
x*sqrt(53225*x**2 - 66732*x + 23013)/2 - 16683*sqrt(53225*x**2 - 66732*x + 23013)/53225 + \ | ||
111576969*sqrt(2129)*asinh(53225*x/10563 - S(11122)/3521)/1133160250 | ||
assert integrate(sqrt(a+b*x+c*x**2), x) == b*sqrt(a + b*x + c*x**2)/(4*c) + x*sqrt(a + b*x + c*x**2)/2 + \ | ||
(2*a - b**2/(2*c))*log(b + 2*sqrt(c)*sqrt(a + b*x + c*x**2) + 2*c*x)/(4*sqrt(c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ThePauliPrinciple
The context is, I supported
References to other Issues or PRs
Fixes #23485
Fixes #11742
Brief description of what is fixed or changed
The rule of this kind of integrals is
$\int\sqrt{a+bx+cx^2}\mathrm{d}x$
$=x\sqrt{a+bx+cx^2}-\int x\mathrm{d}\sqrt{a+bx+cx^2}$
$=x\sqrt{a+bx+cx^2}-\int\frac{x(b+2cx)}{2\sqrt{a+bx+cx^2}}\mathrm{d}x$
$=x\sqrt{a+bx+cx^2}-\int\frac{2(a+bx+cx^2)-2a-bx}{2\sqrt{a+bx+cx^2}}\mathrm{d}x$
$=x\sqrt{a+bx+cx^2}-\int\sqrt{a+bx+cx^2}\mathrm{d}x+\frac{1}{2}\int\frac{2a+bx}{\sqrt{a+bx+cx^2}}\mathrm{d}x$
$=\frac{1}{2}x\sqrt{a+bx+cx^2}+\frac{1}{4}\int\frac{2a+bx}{\sqrt{a+bx+cx^2}}\mathrm{d}x$
This rule doesn't seem represent-able by existing rules, so I define a new rule for it.
Detailed steps should be provided in SymPy Beta after SymPy 1.11 is released.
Other comments
Release Notes