37 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
35 · 87.5%
Assisted
2 · 5%
Worked by hand
3 · 7.5%
Using the packages
Symbolic antiderivatives and analytic enclosures serve different assignments. A decimal midpoint cannot answer a request for an exact form, and a series test may leave an endpoint undecided.
Calculator interface
Offer a method selector for integration and a separate convergence panel for each endpoint. Draw a rotation axis beside the region and let students choose the partition direction.
Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.
Classroom inputs and practical limits
37 of 40 days include a checked executable example. On 18 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.
Ranges across the five units
Days 1–8 · Integration techniques. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
Unit benchmark · symbolic.integrate, degree. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family.
Days 9–16 · Integrals and geometry. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
Unit benchmark · analytic.quadratureRule, Simpson panels. Largest passing sample 2,048 (120 ms, 90.9 MiB peak process RSS). The first sampled passing call above 100 ms used 2,048 (120 ms). The runs did not locate a ceiling for this family.
Days 17–24 · Sequences and convergence. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Unit benchmark · analytic.sequence.nFor, decimal tolerance exponent. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16.
Days 25–32 · Power series. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
Unit benchmark · symbolic.sym.diff, degree. Largest passing sample 1,024 (0.459 ms, 74.4 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 33–40 · Polar and parametric applications. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Unit benchmark · analytic.curve.length, parameter interval end. Largest passing sample 10,000 (3.10 ms, 76.2 MiB peak process RSS). The runs did not locate a ceiling for this family.
Accuracy notes (1)
Fixed · The verifier rejects a false tail index. For aₙ=1/(1+(n−50)²) and ε=1/2, changing N to 1 now fails verification. The later term a₅₀=1 proves the modified claim false.
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("x*exp(x)", "x").result));
Checked output
x*exp(x) - exp(x)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 7.12 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("x^2*log(x)", "x").result));
Checked output
-x^3/9 + x^3*log(x)/3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 2.15 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
const PRINT = console.log;
const F = symbolic.integrate("sin(x)^3", "x");
PRINT(F);
console.log(String(symbolic.equal(String(F.result), "-cos(x) + cos(x)^3/3")));
Checked output
equal (normal form, after the rules the assumptions allow)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 3.48 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
symbolic.equal · 8 passing test cases, 28 distinct argument descriptions
{type="op", op="-", args=[Object, Object] (n=2)}, "x*exp(x)", {assume={x="x > 1"}} or {type="op", op="+", args=[Object, Object] (n=2)}, "1/(x^2+1)^2", {assume={x="x > 1"}} · every result differentiates back to the integrand
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("1/(x^2 + 4)", "x").result));
Checked output
atan(x/2)/2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 2.14 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("1/sqrt(9 - x^2)", "x").result));
Checked output
asin(x/3)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 15.49 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use one or two variables and polynomial degrees roughly 2–6. Rational expressions often have two or three denominator factors.
Focal example. The code above passed its displayed check in 6.80 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.apart · 2 passing test cases, 2 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
const PRINT = console.log;
const F = symbolic.integrate("x*(x^2 + 1)^5", "x");
PRINT(F);
console.log(String(symbolic.equal(`${F.result}`, "(x^2 + 1)^6/12 - 1/12")));
Checked output
equal (normal form)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 1.30 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
symbolic.equal · 8 passing test cases, 28 distinct argument descriptions
{type="op", op="-", args=[Object, Object] (n=2)}, "x*exp(x)", {assume={x="x > 1"}} or {type="op", op="+", args=[Object, Object] (n=2)}, "1/(x^2+1)^2", {assume={x="x > 1"}} · every result differentiates back to the integrand
Find an antiderivative of 2x/(1+x²) and give its real domain.
Worked solution
Substituting u=1+x² gives log(1+x²)+C. Its logarithm has positive argument for every real x.
Using RatMath
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("2*x/(1+x^2)","x")));
Checked output
log(x^2 + 1) + C (proven: its derivative is the integrand)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-variable elementary integrands, usually one substitution, one to three integrations by parts or low-degree partial fractions.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 0.901 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("1/x^2", "x", { from: 1, to: "inf" }).value));
Checked output
1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 46.00 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("1/sqrt(x)", "x", { from: 0, to: 1 }).value));
Checked output
2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 85.83 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
The region under , , is turned about the -axis. Find the volume.
Worked solution
.
Using RatMath
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("pi*sqrt(x)^2", "x", { from: 0, to: 4 }).value));
Checked output
8*pi
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 168 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
const dy = symbolic.sym("2/3*x^(3/2)").diff("x");
console.log(String(symbolic.integrate(`sqrt(1 + (${dy})^2)`, "x", { from: 0, to: 3 }).value));
Checked output
14/3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 148 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.sym · 14 passing test cases, 44 distinct argument descriptions
Direct calculation@ratmath/symbolic · @ratmath/core
Problem
Use Simpson's rule with to estimate . Compare with the exact value.
Worked solution
; exact .
Using RatMath
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
import { R } from "@ratmath/core";
const f = (x) => R`1/(1 + ${x}^2)`, h = R`1/4`;
const S = h.divide(R`3`).multiply(f(0).add(R`4`.multiply(f(h))).add(R`2`.multiply(f(R`1/2`))).add(R`4`.multiply(f(R`3/4`))).add(f(1)));
console.log([S, symbolic.integrate("1/(1 + x^2)", "x", { from: 0, to: 1 }).value]);
Checked output
[8011/10200, pi/4]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 10.09 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("x + 2 - x^2", "x", { from: -1, to: 2 }).value));
Checked output
9/2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 1.34 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Rotate the region 0≤y≤x, 0≤x≤1 about the y-axis. What is the coefficient of π in the volume?
Worked solution
Shell radius and height both equal x. Integrate 2x² from 0 to 1.
Using RatMath
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.integrate("2*x^2","x",{from:0,to:1}).value));
Checked output
2/3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 1.44 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Does symmetry give an ordinary improper integral of 1/x on [−1,1]?
Worked solution
Each one-sided integral diverges. Symmetric truncation gives principal value zero, a different question.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One solid or plane curve; a few panels by hand and up to tens or hundreds for numerical quadrature.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 17 / 40 · Sequences and convergence
Limit of a sequence
Direct calculation@ratmath/symbolic
Problem
Worked solution
.
Using RatMath
Supply the expression, variable and approach point. At jumps and endpoints the direction of approach matters.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.limit("(1 + 2/n)^n", "n", "inf").value));
Checked output
e^2
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
For this problem type. Use one approach point or infinity, low-degree rational or elementary functions, and both directions when the domain permits.
Focal example. The code above passed its displayed check in 11.96 ms on Node.
Same API, measured input family.symbolic.limit · polynomial degree. Baseline test points across courses 1, 2, 3, 6. For n≥1, (x^n−1)/(x−1) tends to n at x=1.
Practical limit. Largest passing sample 128 (1,021 ms, 91.5 MiB peak process RSS). The first sampled passing call above one second used 128 (1,021 ms). The runs did not locate a ceiling for this family. Cancellation is valid on a punctured neighborhood. Left and right limits and branch choices still require checking in general.
Measured times, memory and outcomes
polynomial degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
9.66
76.6
2
Baseline
Passed
9.66
76.4
3
Baseline
Passed
10.35
77
6
Baseline
Passed
16.39
77.6
12
Stretch
Passed
16.71
78.7
32
Stretch
Passed
44.01
88.5
128
Stretch
Passed
1,021
91.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.limit · 4 passing test cases, 18 distinct argument descriptions
"1/x", "x", 0, undefined or "1/x", "x", 0, {side="right"} · one side and two
Day 18 / 40 · Sequences and convergence
p-series
Direct calculation@ratmath/analytic · @ratmath/symbolic
Problem
Does converge? What is its sum?
Worked solution
Yes (a -series with ); the sum is .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
import * as symbolic from "@ratmath/symbolic";
console.log(
[analytic.sum("1/k^2", { variable: "k" }).convergence().convergence, symbolic.sum("1/k^2", "k", 1, "inf").value]
);
Checked output
["absolutely convergent", pi^2/6]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Focal example. The code above passed its displayed check in 58.36 ms on Node.
Related workload in this unit.core.range · terms. Baseline test points across courses 1, 10, 100, 1,000. Check length and every consecutive integer from 1 through n.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (141 ms, 277.5 MiB peak process RSS). The first sampled passing call above 100 ms used 1,000,000 (141 ms). The runs did not locate a ceiling for this family. Keeping the entire result requires storage proportional to its length. Shortening the displayed list after construction still pays that cost.
Measured times, memory and outcomes
terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.173
75.5
10
Baseline
Passed
0.192
74.9
100
Baseline
Passed
0.269
74.7
1,000
Baseline
Passed
1.52
75.6
10,000
Stretch
Passed
5.29
80.9
100,000
Stretch
Passed
11.57
109.6
1,000,000
Stretch
Passed
141
277.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sum · 10 passing test cases, 19 distinct argument descriptions
Direct calculation@ratmath/analytic · @ratmath/symbolic
Problem
Show converges and find its sum.
Worked solution
Ratio . Using at : sum 6.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
import * as symbolic from "@ratmath/symbolic";
console.log(
[analytic.sum("k^2/2^k", { variable: "k" }).ratioTest().conclusion ?? analytic.sum("k^2/2^k", { variable: "k" }).convergence().convergence, symbolic.sum("k^2/2^k", "k", 1, "inf").value]
);
Checked output
["absolutely convergent", 6]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Focal example. The code above passed its displayed check in 9.64 ms on Node.
Related workload in this unit.core.range · terms. Baseline test points across courses 1, 10, 100, 1,000. Check length and every consecutive integer from 1 through n.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (141 ms, 277.5 MiB peak process RSS). The first sampled passing call above 100 ms used 1,000,000 (141 ms). The runs did not locate a ceiling for this family. Keeping the entire result requires storage proportional to its length. Shortening the displayed list after construction still pays that cost.
Measured times, memory and outcomes
terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.173
75.5
10
Baseline
Passed
0.192
74.9
100
Baseline
Passed
0.269
74.7
1,000
Baseline
Passed
1.52
75.6
10,000
Stretch
Passed
5.29
80.9
100,000
Stretch
Passed
11.57
109.6
1,000,000
Stretch
Passed
141
277.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sum · 10 passing test cases, 19 distinct argument descriptions
Direct calculation@ratmath/analytic · @ratmath/symbolic
Problem
Does converge absolutely, conditionally, or not at all? What is the sum?
Worked solution
Conditionally (the harmonic series diverges; the alternating series test applies). Sum .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
import * as symbolic from "@ratmath/symbolic";
console.log(
[analytic.sum("(-1)^(k+1)/k", { variable: "k" }).convergence().convergence, symbolic.sum("(-1)^(k+1)/k", "k", 1, "inf").value]
);
Checked output
["conditionally convergent", log(2)]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Focal example. The code above passed its displayed check in 24.01 ms on Node.
Related workload in this unit.core.range · terms. Baseline test points across courses 1, 10, 100, 1,000. Check length and every consecutive integer from 1 through n.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (141 ms, 277.5 MiB peak process RSS). The first sampled passing call above 100 ms used 1,000,000 (141 ms). The runs did not locate a ceiling for this family. Keeping the entire result requires storage proportional to its length. Shortening the displayed list after construction still pays that cost.
Measured times, memory and outcomes
terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.173
75.5
10
Baseline
Passed
0.192
74.9
100
Baseline
Passed
0.269
74.7
1,000
Baseline
Passed
1.52
75.6
10,000
Stretch
Passed
5.29
80.9
100,000
Stretch
Passed
11.57
109.6
1,000,000
Stretch
Passed
141
277.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sum · 10 passing test cases, 19 distinct argument descriptions
Increasing, since decreases. (attained); (not attained).
Using RatMath
Enter the term in n. The sequence method works with the rule for the terms, so retain the index and its starting value when adapting the example.
JavaScript module
import * as analytic from "@ratmath/analytic";
const a = analytic.sequence("1 - 1/n");
const [s, i] = [a.supremum(), a.infimum()];
console.log([a.monotone().direction, s.value, s.attained, i.value, i.attained]);
Checked output
["increasing", 1, false, 0, true]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
For this problem type. Classroom tolerances often range from 10⁻¹ to 10⁻⁶. The associated N or δ can be orders of magnitude larger or smaller, depending on the function.
Focal example. The code above passed its displayed check in 1.80 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sequence · 21 passing test cases, 27 distinct argument descriptions
Fixed · The verifier rejects a false tail index. For aₙ=1/(1+(n−50)²) and ε=1/2, changing N to 1 now fails verification. The later term a₅₀=1 proves the modified claim false.
Day 22 / 40 · Sequences and convergence
Telescoping series
Direct calculation@ratmath/symbolic
Problem
Sum .
Worked solution
; partial sums .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.sum("1/(n*(n+1))", "n", 1, "inf").value));
Checked output
1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Focal example. The code above passed its displayed check in 2.07 ms on Node.
Related workload in this unit.core.range · terms. Baseline test points across courses 1, 10, 100, 1,000. Check length and every consecutive integer from 1 through n.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (141 ms, 277.5 MiB peak process RSS). The first sampled passing call above 100 ms used 1,000,000 (141 ms). The runs did not locate a ceiling for this family. Keeping the entire result requires storage proportional to its length. Shortening the displayed list after construction still pays that cost.
Measured times, memory and outcomes
terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.173
75.5
10
Baseline
Passed
0.192
74.9
100
Baseline
Passed
0.269
74.7
1,000
Baseline
Passed
1.52
75.6
10,000
Stretch
Passed
5.29
80.9
100,000
Stretch
Passed
11.57
109.6
1,000,000
Stretch
Passed
141
277.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.sum · 4 passing test cases, 14 distinct argument descriptions
Can the infinite series with terms n/(n+1) converge?
Worked solution
Its terms approach 1. Failure of the necessary zero-term condition forces divergence.
Using RatMath
Enter the term in n. The sequence method works with the rule for the terms, so retain the index and its starting value when adapting the example.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.sequence("n/(n+1)").limit());
Checked output
1
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
For this problem type. Classroom tolerances often range from 10⁻¹ to 10⁻⁶. The associated N or δ can be orders of magnitude larger or smaller, depending on the function.
Focal example. The code above passed its displayed check in 0.226 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sequence · 21 passing test cases, 27 distinct argument descriptions
Fixed · The verifier rejects a false tail index. For aₙ=1/(1+(n−50)²) and ε=1/2, changing N to 1 now fails verification. The later term a₅₀=1 proves the modified claim false.
Day 24 / 40 · Sequences and convergence
Absolute versus conditional
Worked by hand
Problem
How does the alternating harmonic series converge?
Worked solution
Decreasing magnitudes tending to zero give convergence. Absolute values give the divergent harmonic series.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. A series specified by its general term. Partial sums of roughly 5–100 terms illustrate behavior; convergence quantifies over the whole tail.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 25 / 40 · Power series
Interval of convergence
Direct calculation@ratmath/analytic
Problem
Find the interval of convergence of .
Worked solution
. At : harmonic, diverges; at : alternating harmonic, converges. .
Using RatMath
Enter the coefficient as a function of the index. Keep the centre and starting index with the series when reading the convergence result.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.powerSeries("1/(n*2^n)", { index: "n", from: 1, centre: 3 }).interval().text);
Checked output
[1, 5)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
Focal example. The code above passed its displayed check in 1.66 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.powerSeries · 2 passing test cases, 5 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.taylor("cos(x)", "x", 0, 4)));
Checked output
1 - 1/2*x^2 + 1/24*x^4 + …
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
For this problem type. Typical hand calculations keep 2–10 nonzero terms. Specify the expansion center and distance of the evaluation point from it.
Focal example. The code above passed its displayed check in 0.413 ms on Node.
Related workload in this unit.symbolic.sym.diff · degree. Baseline test points across courses 1, 2, 4, 8. Derivative of x^n at 2 is n·2^(n−1).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,024 (0.459 ms, 74.4 MiB peak process RSS). The runs did not locate a ceiling for this family. A monomial differentiates to one term. Products, repeated derivatives and expression expansion can make intermediate expressions much larger.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.157
75.7
2
Baseline
Passed
0.192
75.7
4
Baseline
Passed
0.276
75.2
8
Baseline
Passed
0.642
75.5
16
Stretch
Passed
18.83
74.7
64
Stretch
Passed
0.406
75
256
Stretch
Passed
0.241
75.3
1,024
Stretch
Passed
0.459
74.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.taylor · 2 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(String(symbolic.taylor("exp(x)", "x", 1, 3)));
Checked output
e + e*(x - 1) + e/2*(x - 1)^2 + e/6*(x - 1)^3 + …
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
For this problem type. Typical hand calculations keep 2–10 nonzero terms. Specify the expansion center and distance of the evaluation point from it.
Focal example. The code above passed its displayed check in 0.402 ms on Node.
Related workload in this unit.symbolic.sym.diff · degree. Baseline test points across courses 1, 2, 4, 8. Derivative of x^n at 2 is n·2^(n−1).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,024 (0.459 ms, 74.4 MiB peak process RSS). The runs did not locate a ceiling for this family. A monomial differentiates to one term. Products, repeated derivatives and expression expansion can make intermediate expressions much larger.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.157
75.7
2
Baseline
Passed
0.192
75.7
4
Baseline
Passed
0.276
75.2
8
Baseline
Passed
0.642
75.5
16
Stretch
Passed
18.83
74.7
64
Stretch
Passed
0.406
75
256
Stretch
Passed
0.241
75.3
1,024
Stretch
Passed
0.459
74.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.taylor · 2 passing test cases, 7 distinct argument descriptions
Direct calculation@ratmath/analytic · @ratmath/symbolic · @ratmath/core
Problem
Approximate by its degree-2 Maclaurin polynomial and bound the error.
Worked solution
. . (True error .)
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import * as analytic from "@ratmath/analytic";
import * as symbolic from "@ratmath/symbolic";
import { R } from "@ratmath/core";
const T = symbolic.taylor("exp(x)", "x", 0, 2);
const r = analytic.taylorRemainder("exp(x)", { about: 0, order: 2, on: [0, "0.1"] });
console.log(
[String(T.polynomial), T.polynomial.evaluate({ x: "0.1" }).low.toDecimal(), r.bound.lessThan(R`0.0002`), r.actual.high.toDecimal(6)]
);
Checked output
["1 + x + 1/2*x^2", "1.105", true, "0.000170"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
For this problem type. Typical hand calculations keep 2–10 nonzero terms. Specify the expansion center and distance of the evaluation point from it.
Focal example. The code above passed its displayed check in 409 ms on Node.
Related workload in this unit.core.Rational.roundTo · decimal places. Baseline test points across courses 0, 1, 2, 4, 10. Round one third toward zero and compare with (10^d−1)/(3×10^d).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (0.132 ms, 75.8 MiB peak process RSS). The runs did not locate a ceiling for this family. Extra decimal places require longer integers and more output. Choose rounding mode and decimal places explicitly for money or signed values.
Measured times, memory and outcomes
decimal places · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.113
75
1
Baseline
Passed
0.151
75
2
Baseline
Passed
0.123
75.6
4
Baseline
Passed
0.119
75.1
10
Baseline
Passed
0.120
76.2
50
Stretch
Passed
0.418
75.2
250
Stretch
Passed
0.124
75.2
1,000
Stretch
Passed
0.132
75.8
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.taylor · 2 passing test cases, 7 distinct argument descriptions
Enter the coefficient as a function of the index. Keep the centre and starting index with the series when reading the convergence result.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.powerSeries("n^2/3^n").radius().radius);
Checked output
3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
Focal example. The code above passed its displayed check in 0.639 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.powerSeries · 2 passing test cases, 5 distinct argument descriptions
Bound the error of the degree-4 Taylor polynomial of about 0 on , and compare with the true error.
Worked solution
Lagrange: . The true maximum error, at , is .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
const T = analytic.taylorRemainder("exp(x)", { order: 4, on: ["0", "1"] });
console.log([T.bound, T.actual]);
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
For this problem type. Typical hand calculations keep 2–10 nonzero terms. Specify the expansion center and distance of the evaluation point from it.
Focal example. The code above passed its displayed check in 346 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.symbolic.sym.diff · degree. Baseline test points across courses 1, 2, 4, 8. Derivative of x^n at 2 is n·2^(n−1).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,024 (0.459 ms, 74.4 MiB peak process RSS). The runs did not locate a ceiling for this family. A monomial differentiates to one term. Products, repeated derivatives and expression expansion can make intermediate expressions much larger.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.157
75.7
2
Baseline
Passed
0.192
75.7
4
Baseline
Passed
0.276
75.2
8
Baseline
Passed
0.642
75.5
16
Stretch
Passed
18.83
74.7
64
Stretch
Passed
0.406
75
256
Stretch
Passed
0.241
75.3
1,024
Stretch
Passed
0.459
74.4
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.taylorRemainder · 1 passing test case, 1 distinct argument description
For the series with terms xⁿ/n starting at n=1, which endpoints of (−1,1) extend the convergence interval?
Worked solution
At −1 it is alternating harmonic. At 1 it is harmonic. The interval is [−1,1).
Using RatMath
Enter the coefficient as a function of the index. Keep the centre and starting index with the series when reading the convergence result.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.powerSeries("1/n",{from:1}).interval().text);
Checked output
[-1, 1)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
Focal example. The code above passed its displayed check in 0.778 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.powerSeries · 2 passing test cases, 5 distinct argument descriptions
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`1/(3*2*1)`));
Checked output
1/6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Taylor orders commonly 2–10, small integer powers and an explicit expansion point and error interval.
Focal example. The code above passed its displayed check in 0.115 ms on Node.
Same arithmetic expression. Replaced its first numeral 1 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(
String(symbolic.integrate("1/2*(2cos(t))^2", "t", { from: "-pi/2", to: "pi/2" }).value)
);
Checked output
pi
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 10.08 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Convert the polar point to rectangular coordinates.
Worked solution
.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log([symbolic.simplify("4cos(5pi/6)"), symbolic.simplify("4sin(5pi/6)")]);
Checked output
[-2*sqrt(3), 2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Focal example. The code above passed its displayed check in 0.885 ms on Node.
Related workload in this unit.symbolic.expand · degree. Baseline test points across courses 1, 2, 4, 8. Sum the expanded coefficients at x=1 by direct substitution; result 2^n. Also check at x=0 and 2.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (47.68 ms, 96.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A univariate binomial has n+1 terms. With several variables the number of monomials can grow combinatorially even at modest degree.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
26.10
75.9
2
Baseline
Passed
3.05
75.5
4
Baseline
Passed
2.75
77.3
8
Baseline
Passed
4.23
79.5
16
Stretch
Passed
5.88
82.6
32
Stretch
Passed
6.12
87.9
64
Stretch
Passed
15.73
89.5
128
Stretch
Passed
47.68
96.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.simplify · 2 passing test cases, 11 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Focal example. The code above passed its displayed check in 5.55 ms on Node.
Related workload in this unit.symbolic.expand · degree. Baseline test points across courses 1, 2, 4, 8. Sum the expanded coefficients at x=1 by direct substitution; result 2^n. Also check at x=0 and 2.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (47.68 ms, 96.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A univariate binomial has n+1 terms. With several variables the number of monomials can grow combinatorially even at modest degree.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
26.10
75.9
2
Baseline
Passed
3.05
75.5
4
Baseline
Passed
2.75
77.3
8
Baseline
Passed
4.23
79.5
16
Stretch
Passed
5.88
82.6
32
Stretch
Passed
6.12
87.9
64
Stretch
Passed
15.73
89.5
128
Stretch
Passed
47.68
96.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.eliminate · 7 passing test cases, 15 distinct argument descriptions
For the helix , find the length for and the curvature.
Worked solution
Speed : length . Curvature .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
const c = analytic.curve(["cos(t)", "sin(t)", "t"], "t");
console.log([c.length([0, "2*pi"]), c.curvature()]);
Checked output
[8.8857658763167324940[2:4], "1/2"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
For this problem type. Use one or two parameters, two or three ambient coordinates and one regular evaluation point or a short parameter interval.
Focal example. The code above passed its displayed check in 4.90 ms on Node.
Same API, measured input family.analytic.curve.length · parameter interval end. Baseline test points across courses 1, 2, 5, 10. The straight curve (3t,4t) from 0 to n has length 5n.
Practical limit. Largest passing sample 10,000 (3.10 ms, 76.2 MiB peak process RSS). The runs did not locate a ceiling for this family. Smooth straight-line speed is constant here. Near a cusp or a zero of speed, curvature can be undefined and length integration harder.
Measured times, memory and outcomes
parameter interval end · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
2.87
75.7
2
Baseline
Passed
2.89
75.5
5
Baseline
Passed
2.81
75.3
10
Baseline
Passed
2.85
76.1
100
Stretch
Passed
2.93
75.3
1,000
Stretch
Passed
3.16
75.2
10,000
Stretch
Passed
3.10
76.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.curve · 3 passing test cases, 7 distinct argument descriptions
A point follows (3t,4t) from t=0 to t=2. Find the distance traveled.
Worked solution
Its velocity has length 5 at all times. Integrating the speed over two time units gives 10.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`2*5`));
Checked output
10
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Focal example. The code above passed its displayed check in 0.104 ms on Node.
Same arithmetic expression. Replaced its first numeral 2 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Why can integrating over 0≤θ≤2π double-count the circle r=2 cos θ?
Worked solution
At θ+π the radius changes sign and the direction reverses, giving the same point. Use an interval of length π to trace the circle once.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 39 / 40 · Polar and parametric applications
Hydrostatic force
Direct calculation@ratmath/core
Problem
A 1 m² vertical strip is centred at 2 m depth in water of weight density 9800 N/m³. Find its force if pressure varies linearly with depth.
Worked solution
Multiplying area by pressure at the centroid is exact for this plane surface.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`9800*2*1`));
Checked output
19600
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Focal example. The code above passed its displayed check in 0.054 ms on Node.
Same arithmetic expression. Replaced its first numeral 9800 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
How large is the sum of (1/3)ⁿ from n=5 to infinity?
Worked solution
Divide the first omitted term by one minus the ratio.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`(1/3)^5/(1-1/3)`));
Checked output
1/162
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One polar or parametric curve over one turn or a subinterval; identify repeated tracing before integrating.
Focal example. The code above passed its displayed check in 0.126 ms on Node.
Same arithmetic expression. Replaced its first numeral 1 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.multiply · operand bits. Baseline test points across courses 8, 32, 64, 256. Cross-multiply the unreduced integer products; operands have unlike denominators.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 131,072 (1.53 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Intermediate products can have twice the bit length of their factors. Repeated squaring can exhaust the engine’s BigInt allocation limit in a small number of steps.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
0.317
74.6
32
Baseline
Passed
0.035
75.5
64
Baseline
Passed
0.045
75.1
256
Baseline
Passed
0.106
74
1,024
Stretch
Passed
0.035
75.3
8,192
Stretch
Passed
0.075
75.8
32,768
Stretch
Passed
0.245
75
131,072
Stretch
Passed
1.53
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions