Skip to content

Integrate a constant over x squared times the root of a quadratic (#233) - #691

Merged
Happypig375 merged 1 commit into
ASC-Community:masterfrom
Rafael-SOWNet:feat/root-over-square
Aug 4, 2026
Merged

Happypig375 merged 1 commit into
ASC-Community:masterfrom
Rafael-SOWNet:feat/root-over-square

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member
"1 / (x ^ 2 * sqrt(x ^ 2 - 1))".Integrate("x")
// master: integral(1 / (x ^ 2 * sqrt(x ^ 2 - 1)), x)

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)/x gives -c/(x² · sqrt(ax² + 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:

1/(x²√(x²−1)) root of a difference
1/(x²√(x²+1)) root of a sum
1/(x²√(1−x²)) sign of x² the other way
1/(x²√(4−x²)), 1/(x²√(2x²+3)) with coefficients
3/(x²√(x²−4)), 1/(2x²√(x²+9)), −1/(x²√(x²+1)) a constant anywhere in the quotient

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 a there 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-sub goes from 67% to 100% — with nothing wrong, in error or timing out.

∫ 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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.46%. Comparing base (90c00a8) to head (5a1459e).
⚠️ Report is 58 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Happypig375
Happypig375 merged commit 22a1a75 into ASC-Community:master Aug 4, 2026
24 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the feat/root-over-square branch August 4, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants