Repository navigation
Integrate a constant over x squared times the root of a quadratic (#233) - #691
Merged
Happypig375 merged 1 commit intoAug 4, 2026
Merged
Conversation
∫ k / (x^2 * sqrt(ax^2 + c)) dx had no antiderivative at all -- the shape a trigonometric substitution is usually taught for, and one of the ones named in #233. No substitution is needed to state the answer. Differentiating sqrt(ax^2 + c)/x gives -c/(x^2 * sqrt(ax^2 + c)) exactly, so the whole family is one formula and there is no case analysis over the signs of a and c to get wrong: the root of a sum and of a difference, and both with the sign of x^2 the other way round, all come out of it. A radicand with a linear term or with either coefficient zero is refused. A zero constant term is what the formula divides by, and with a zero a there is no root of x left to speak of. 17 tests, 8 of which fail without the change, each checked by differentiating the answer back. 4026 in all, 127 F#, corpus 102/117 with int:trig-sub at 100% from 67% and nothing wrong, in error or timing out.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #691 +/- ##
==========================================
- Coverage 80.99% 80.46% -0.54%
==========================================
Files 155 156 +1
Lines 13687 12953 -734
Branches 1957 2130 +173
==========================================
- Hits 11086 10422 -664
+ Misses 1990 1922 -68
+ Partials 611 609 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shape a trigonometric substitution is usually taught for, and one of the ones named in #233's list of what is missing.
No substitution needed to state the answer
Differentiating
sqrt(ax² + c)/xgives-c/(x² · sqrt(ax² + c))exactly. So the whole family is one formula, and there is no case analysis over the signs ofaandcto get wrong:1/(x²√(x²−1))1/(x²√(x²+1))1/(x²√(1−x²))1/(x²√(4−x²)),1/(x²√(2x²+3))3/(x²√(x²−4)),1/(2x²√(x²+9)),−1/(x²√(x²+1))What it refuses
A radicand with a linear term, or with either coefficient zero. A zero constant term is what the formula divides by; with a zero
athere is no root of x left to speak of. Both are left unevaluated and pinned as such.Verification
17 tests, 8 of which fail without the change, each checked by differentiating the answer back and comparing at points. 4026 unit tests and 127 F# tests on both target frameworks, none failing. 117-problem self-verifying corpus at 102/117 —
int:trig-subgoes from 67% to 100% — with nothing wrong, in error or timing out.