Skip to content

Commit e006a79

Browse files
Ask the radicand rule's rewriting without the condition its inner simplification writes (#2045)
Rubi's 7.2.5 x/(acosh(x) sqrt(x - 1) sqrt(x + 1)) ran past the budget. SolveByWritingAConstantMultipleOfARadicandOverIt writes the pair of roots as the root of x^2 - 1 that acosh(x) holds, with the constant factor K, and the inner simplification of the rewriting put provided not x - 1 = 0 over the whole of it: the inverse hyperbolic substitution did not read the condition, and the search split the sum and went by parts. The point it excludes is outside the integrand's domain, and the question is now asked bare. (A derivative check on the rule's answer was tried and dropped: it took three of Rubi's 5.1.4 arcsine rows, answered in 0.2 to 1.4 s, past the budget.) Part of #233. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ef4150e commit e006a79

3 files changed

Lines changed: 62 additions & 1 deletion

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,18 @@ becomes a polynomial in `u` times exponentials and trigonometric functions, and
542542
| `"(a+b*atan(c*x))^2/(1+i*c*x)^4".ToEntity().Integrate("x")` | `integral(...)` | 731 characters |
543543
| `"(a+b*atan(c*x))^3/(d+i*c*d*x)^4".ToEntity().Integrate("x")` | `integral(...)` | 1,202 characters |
544544

545+
### Two roots of linears written as an inverse hyperbolic cosine's radicand are asked without a condition
546+
547+
**Answers where there were none.** Rubi's 7.2.5 `x/(acosh(x) sqrt(x - 1) sqrt(x + 1))` ran past the budget. The pair of roots
548+
is written as the root of `x^2 - 1` that `acosh(x)` holds, with the factor `K` that is constant where it is defined.
549+
The inner simplification then wrote the rewritten question with `provided not x - 1 = 0` over the whole of it, and
550+
nothing below read that. The point it excludes is outside the integrand's domain, and the question is now asked
551+
without it ([#233](https://github.com/asc-community/AngouriMath/issues/233)).
552+
553+
| Input | Was (2.5.0) | Now |
554+
|---|---|---|
555+
| `"x/(acosh(x)*sqrt(-1+x)*sqrt(1+x))".ToEntity().Integrate("x")` | `integral(...)` | 93 characters, `K Chi(acosh(x))` |
556+
545557
### An arcoth of a linear is integrated as its artanh plus a constant
546558

547559
**Answers where there were none.** `acoth(x)^2/(1 - x^2)^2`, Rubi's 7.4.1, was declined, where

‎Sources/AngouriMath/Functions/Continuous/Integration/IndefiniteIntegralSolver.cs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43437,7 +43437,12 @@ Entity WithTheExponentials(Entity e, Entity? one)
4343743437
(rewritten, root) = (paired, pairRoot);
4343843438
if (rewritten == expr)
4343943439
return null;
43440-
var simplified = rewritten.InnerSimplified;
43440+
// Without a condition over the whole of it, which the inner simplification writes where a
43441+
// linear stands on both sides of the bar and nothing below reads: Rubi's 7.2.5
43442+
// `x/(acosh(x) sqrt(x - 1) sqrt(x + 1))` became `x/(K sqrt(x^2 - 1) acosh(x)) provided not
43443+
// x - 1 = 0`, and ran past the budget, where without the condition it is a `Chi`. The point
43444+
// it excludes is outside the integrand's domain.
43445+
var simplified = Functions.PartialFractions.Bare(rewritten.InnerSimplified);
4344143446
if (simplified == expr || simplified == expr.InnerSimplified)
4344243447
return null;
4344343448
if (Integration.ComputeAsTheSameQuestion(simplified, x, integrateByParts) is not { } answer)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// Copyright (c) 2019-2026 Angouri.
3+
// AngouriMath is licensed under MIT.
4+
// Details: https://github.com/asc-community/AngouriMath/blob/master/LICENSE.md.
5+
// Website: https://am.angouri.org.
6+
//
7+
8+
using System;
9+
using AngouriMath.Extensions;
10+
using Xunit;
11+
12+
namespace AngouriMath.Tests.Calculus
13+
{
14+
/// <summary>
15+
/// Two roots of linears written as the radicand an inverse hyperbolic cosine holds, asked without
16+
/// the condition the inner simplification writes over the rewriting: Rubi's 7.2.5
17+
/// <c>x/(acosh(x) sqrt(x - 1) sqrt(x + 1))</c> was asked as <c>... provided not x - 1 = 0</c> and ran
18+
/// past the budget, where it is a hyperbolic cosine integral.
19+
/// <a href="https://github.com/asc-community/AngouriMath/issues/233">#233</a>
20+
/// </summary>
21+
[Trait("Area", "Calculus")]
22+
public sealed class TheRadicandRewritingAskedWithoutItsConditionIntegralTest
23+
{
24+
[Theory]
25+
[InlineData("x/(acosh(x)*sqrt(-1 + x)*sqrt(1 + x))")]
26+
[InlineData("x^2/(acosh(x)*sqrt(-1 + x)*sqrt(1 + x))")]
27+
public void IsAnswered(string integrand)
28+
{
29+
var integral = integrand.ToEntity().Integrate("x");
30+
var text = integral.Stringize();
31+
Assert.DoesNotContain("integral(", text);
32+
var derivative = integral.Substitute("C", 0).Differentiate("x");
33+
var original = integrand.ToEntity();
34+
foreach (var at in new[] { 1.2, 1.7, 2.3, 3.1, 4.4 })
35+
{
36+
var want = original.Substitute("x", at).EvalNumerical();
37+
var got = derivative.Substitute("x", at).EvalNumerical();
38+
Assert.True(Math.Abs((double)(got - want).RealPart) + Math.Abs((double)(got - want).ImaginaryPart)
39+
< 1e-9 * Math.Max(1, Math.Abs((double)want.RealPart) + Math.Abs((double)want.ImaginaryPart)),
40+
$"d/dx of the antiderivative of {integrand} is {got} at x = {at}, where the integrand is {want}");
41+
}
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)