|
| 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 AngouriMath.Extensions; |
| 9 | +using Xunit; |
| 10 | + |
| 11 | +namespace AngouriMath.Tests.Calculus |
| 12 | +{ |
| 13 | + /// <summary> |
| 14 | + /// A quotient whose dividend tends to an infinity and whose divisor vanishes from one side tends to the infinity of |
| 15 | + /// the two signs' product. The quotient of the parts' limits, (-oo) / 0, says nothing about the divisor's side and is |
| 16 | + /// NaN, and the rule that reads the side asked for a finite dividend: ln(x^2) / (cos(x) - 1) at 0, +oo from both |
| 17 | + /// sides, was NaN, the claim that it has no limit. |
| 18 | + /// <a href="https://github.com/asc-community/AngouriMath/issues/2274">#2274</a> |
| 19 | + /// </summary> |
| 20 | + [Trait("Area", "Calculus")] |
| 21 | + public sealed class AnInfinityOverAVanishingDivisorTest |
| 22 | + { |
| 23 | + [Theory] |
| 24 | + [InlineData("limit(ln(x^2) / ln(1 - x^2/2), x, 0)", "+oo")] |
| 25 | + [InlineData("limit(ln(x^2) / (cos(x) - 1), x, 0)", "+oo")] |
| 26 | + [InlineData("limit(ln(abs(x)) / ln(cos(x)), x, 0)", "+oo")] |
| 27 | + [InlineData("limit(ln(x^2) / ln(cos(x)), x, 0)", "+oo")] |
| 28 | + [InlineData("limitright(ln(x) / sin(x), x, 0)", "-oo")] |
| 29 | + [InlineData("limitleft(ln(-x) / sin(x), x, 0)", "+oo")] |
| 30 | + [InlineData("limitright((1/x) / sin(x), x, 0)", "+oo")] |
| 31 | + [InlineData("limit(1/x^2, x, 0)", "+oo")] |
| 32 | + public void ItIsTheInfinityOfTheSigns(string limit, string value) |
| 33 | + => Assert.Equal(value.ToEntity(), limit.ToEntity().Simplify()); |
| 34 | + |
| 35 | + /// <summary>Where the sides disagree, or one has no real value, there is still no limit.</summary> |
| 36 | + [Theory] |
| 37 | + [InlineData("limit(1/x, x, 0)")] |
| 38 | + [InlineData("limit(x^x, x, 0)")] |
| 39 | + [InlineData("limit(ln(x) / x, x, 0)")] |
| 40 | + public void WhereTheSidesDoNotAgreeThereIsNone(string limit) |
| 41 | + => Assert.Equal(MathS.NaN, limit.ToEntity().Simplify()); |
| 42 | + } |
| 43 | +} |
0 commit comments