Calculus III: several variables and vector calculus
Use the left and right arrow keys to turn pages.
Course summary
Where RatMath helps
85%
34 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
32 · 80%
Assisted
2 · 5%
Worked by hand
6 · 15%
Using the packages
Vector and calculus packages give derivatives, integrals and enclosures. Correct coordinates, orientation and integration bounds often determine the answer before any arithmetic begins.
Calculator interface
Let students sketch the region, set bounds by sweeping a slice, and reverse an orientation visibly. Show the Jacobian factor and coordinate ranges beside the integrand.
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
34 of 40 days include a checked executable example. On 11 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 · Spatial curves and vectors. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
Unit benchmark · geo.midpoint, absolute coordinate. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 9–16 · Multivariable derivatives. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
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 17–24 · Multiple integrals. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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 25–32 · Vector fields. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
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 33–40 · Surfaces and flux. A two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
Unit benchmark · analytic.surface, coefficient of the mixed term. Largest passing sample 100 (5.09 ms, 76.7 MiB peak process RSS). The runs did not locate a ceiling for this family.
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as geo from "@ratmath/geo";
const u = geo.vector(1, 2, -2);
console.log([u.dot([3, 0, 4]), String(u.cross([3, 0, 4]))]);
Checked output
[-5, "(8, -10, -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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
Focal example. The code above passed its displayed check in 0.201 ms on Node.
Related workload in this unit.geo.midpoint · absolute coordinate. Baseline test points across courses 0, 1, 10, 100. Midpoint of (−k,0) and (k,2k) equals (0,k).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Coordinate size and dimension affect exact distance and dot products. Floating geometry near coincidence can lose significant digits.
Measured times, memory and outcomes
absolute coordinate · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.193
74.9
1
Baseline
Passed
0.197
75.2
10
Baseline
Passed
0.151
75.4
100
Baseline
Passed
0.169
75.6
1,000,000
Stretch
Passed
0.298
76.3
1,000,000,000
Stretch
Passed
0.175
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.
geo.vector · 4 passing test cases, 14 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 geo from "@ratmath/geo";
console.log(geo.plane([1, 0, 2], [2, 1, 0], [0, 3, 1]).equation);
Checked output
5x + 3y + 4z = 13
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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
Focal example. The code above passed its displayed check in 0.345 ms on Node.
Related workload in this unit.geo.midpoint · absolute coordinate. Baseline test points across courses 0, 1, 10, 100. Midpoint of (−k,0) and (k,2k) equals (0,k).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Coordinate size and dimension affect exact distance and dot products. Floating geometry near coincidence can lose significant digits.
Measured times, memory and outcomes
absolute coordinate · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.193
74.9
1
Baseline
Passed
0.197
75.2
10
Baseline
Passed
0.151
75.4
100
Baseline
Passed
0.169
75.6
1,000,000
Stretch
Passed
0.298
76.3
1,000,000,000
Stretch
Passed
0.175
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.
geo.plane · 3 passing test cases, 7 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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
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
Direct calculation@ratmath/symbolic · @ratmath/geo
Problem
For and , find , and the angle between them to 0.01°.
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";
import * as geo from "@ratmath/geo";
const u = [3, -4], v = [2, 1];
console.log(
[geo.distance([0, 0], u), geo.dot(geo.point(...u), geo.point(...v)), symbolic.evaluate(symbolic.parse("acos(2/(5*sqrt(5)))*180/pi"))]
);
Checked output
[5, 2, 79.6951535312339680[4793:5835]]
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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
Focal example. The code above passed its displayed check in 2.73 ms on Node.
Same API, measured input family.symbolic.evaluate / symbolic.parse · scalar multiplier. Baseline test points across courses 1, 2, 10, 100. At π/6, n sin(π/6)=n/2. Check inclusion or double agreement.
Practical limit. Largest passing sample 1,000,000 (6.79 ms, 75.2 MiB peak process RSS). The runs did not locate a ceiling for this family. Angle units and distance to poles matter more than multiplier size. Use enclosures when cancellation or a near-zero denominator affects the answer.
Measured times, memory and outcomes
scalar multiplier · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
2.28
75.9
2
Baseline
Passed
2.46
76.7
10
Baseline
Passed
2.30
76.1
100
Baseline
Passed
2.26
75.9
1,000
Stretch
Passed
4.48
76.4
1,000,000
Stretch
Passed
6.79
75.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.
geo.distance · 3 passing test cases, 2 distinct argument descriptions
For the helix , find the speed, curvature and torsion.
Worked solution
. For : , .
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 h = analytic.curve(["cos(t)", "sin(t)", "t/2"], "t");
console.log([h.speed(), h.curvature(), h.torsion()].map(String));
Checked output
["sqrt(5/4)", "4/5", "2/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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
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 1.32 ms on Node.
Related workload in this unit.geo.midpoint · absolute coordinate. Baseline test points across courses 0, 1, 10, 100. Midpoint of (−k,0) and (k,2k) equals (0,k).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,000 (0.175 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Coordinate size and dimension affect exact distance and dot products. Floating geometry near coincidence can lose significant digits.
Measured times, memory and outcomes
absolute coordinate · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.193
74.9
1
Baseline
Passed
0.197
75.2
10
Baseline
Passed
0.151
75.4
100
Baseline
Passed
0.169
75.6
1,000,000
Stretch
Passed
0.298
76.3
1,000,000,000
Stretch
Passed
0.175
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.
analytic.curve · 3 passing test cases, 7 distinct argument descriptions
The velocity components are perpendicular with constant norm 5.
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 algebraic from "@ratmath/algebraic";
console.log(String(algebraic.sqrt(9+16).toRational()));
Checked output
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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
Focal example. The code above passed its displayed check in 0.093 ms on Node.
Same API, measured input family.algebraic.sqrt · integer scale k. Baseline test points across courses 1, 2, 7, 50. √(k²) has the nonnegative rational value k.
Practical limit. Largest passing sample 1,000,000 (0.266 ms, 74.3 MiB peak process RSS). The runs did not locate a ceiling for this family. This sweep uses perfect squares. Nonsquares involve algebraic representations and higher-degree combinations can cost substantially more.
Measured times, memory and outcomes
integer scale k · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.312
75.2
2
Baseline
Passed
0.275
75.7
7
Baseline
Passed
0.237
75.3
50
Baseline
Passed
0.238
74.1
10,000
Stretch
Passed
0.285
74.1
1,000,000
Stretch
Passed
0.266
74.3
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.
algebraic.sqrt · 17 passing test cases, 8 distinct argument descriptions
The gradient is twice the position vector, so (2,4,4) is a normal.
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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
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 08 / 40 · Spatial curves and vectors
Projection
Direct calculation@ratmath/linalg
Problem
Project onto the line spanned by .
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 linalg from "@ratmath/linalg";
const A = [[1], [1], [1]];
console.log(String(linalg.multiply(A, linalg.leastSquares(A, [[1], [2], [3]]).exact().x)));
Checked output
[2]
[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. Two or three coordinates, a small collection of vectors, curves with one parameter and surfaces in three-space.
For this problem type. Hand fits use about 4–12 paired observations. A classroom dataset can have tens to hundreds of rows and one to five predictors. Include a nonconstant predictor.
Focal example. The code above passed its displayed check in 1.69 ms on Node.
Same API, measured input family.linalg.leastSquares.exact · observations. Baseline test points across courses 2, 3, 5, 20. For y=2+3x, recover both coefficients with zero residual.
Practical limit. Largest passing sample 2,000 (68.14 ms, 92.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost depends on both observations and independent columns. Collinearity can destroy uniqueness, and near-collinearity makes floating fits sensitive.
Measured times, memory and outcomes
observations · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.88
75.3
3
Baseline
Passed
2.81
75.9
5
Baseline
Passed
2.05
74.7
20
Baseline
Passed
2.43
75.7
100
Stretch
Passed
4.00
75.9
500
Stretch
Passed
18.48
81.3
2,000
Stretch
Passed
68.14
92.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.
linalg.leastSquares · 1 passing test case, 2 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";
const f = symbolic.sym("x^2*y^3 + exp(x*y)");
console.log([f.diff("x"), f.diff("y")]);
Checked output
[2*x*y^3 + exp(x*y)*y, 3*x^2*y^2 + exp(x*y)*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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 0.225 ms on Node.
Same API, measured input family.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. 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. 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
For , find at and the derivative in the direction .
Worked solution
; unit direction : .
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 f = analytic.field("x^2*y + y*z", ["x", "y", "z"]);
console.log(
[f.gradient().map((g) => g.value([1, 2, 3]).exact()), f.directional([1, 2, 3], [2, 1, -2]).exact()]
);
Checked output
[[4, 4, 2], 8/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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 1.01 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.
analytic.field · 20 passing test cases, 22 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 analytic from "@ratmath/analytic";
console.log(analytic.field("x^2 + y^2", ["x", "y"]).linearization([1, 2]).toString());
Checked output
5 + 2*(x - 1) + 4*(y - 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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 0.889 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.
analytic.field · 20 passing test cases, 22 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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 91.32 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.
analytic.field · 20 passing test cases, 22 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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 802 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.lagrange · 1 passing test case, 2 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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
Focal example. The code above passed its displayed check in 1.51 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.
analytic.field · 20 passing test cases, 22 distinct argument descriptions
It is zero on y=0 and 1/2 on y=x away from the origin. Different path limits disprove existence.
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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
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 16 / 40 · Multivariable derivatives
An inconclusive Hessian
Worked by hand
Problem
At (0,0) the Hessian of x⁴+y⁴ vanishes. Is the point a minimum?
Worked solution
Yes. Both fourth powers are nonnegative and equality requires both coordinates to vanish.
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. Two or three variables, first or second partial derivatives, one or two constraints and isolated critical points.
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 · Multiple integrals
Double integral
Direct calculation@ratmath/symbolic
Problem
Worked solution
Inner: . Outer: .
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(String(symbolic.integrate("x + y^2", "y", { from: 0, to: 2 }).value), "x", { from: 0, to: 1 }).value)
);
Checked output
11/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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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.984 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
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";
const r = symbolic.reverseOrder("exp(y^2)", { outer: ["x", 0, 1], inner: ["y", "x", 1] });
console.log([r.text, String(r.value), r.agree]);
Checked output
["∫ from 0 to 1 ∫ from 0 to y exp(y^2) dx dy", "e/2 - 1/2", "checked"]
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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
Focal example. The code above passed its displayed check in 127 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.reverseOrder · 6 passing test cases, 7 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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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 9,190 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.changeOfVariables · 2 passing test cases, 3 distinct argument descriptions
"x^2 + y^2", ["x", "y"] (n=2), {x="r*cos(t)", y="r*sin(t)"}, ["r", "t"] (n=2), {r=[0, 1] (n=2), t=[0, "2*pi"] (n=2)} · polar coordinates show the factor r
"x + y", ["x", "y"] (n=2), {x="u + v", y="u - v"}, ["u", "v"] (n=2), {u=[0, 1] (n=2), v=[0, 1] (n=2)} or "x + y", ["x", "y"] (n=2), {x="2*u", y="3*v"}, ["u", "v"] (n=2), {u=[0, 1] (n=2), v=[0, 1] (n=2)}, {original={x=array[2], y=array[2]}} · a negative determinant is used by its size, and the direct integral agrees
Day 20 / 40 · Multiple integrals
Triple integral
Direct calculation@ratmath/symbolic
Problem
Find the volume of the tetrahedron , .
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";
const inner = symbolic.integrate("1 - x - y", "y", { from: 0, to: "1 - x" }).value;
console.log(String(symbolic.integrate(String(inner), "x", { from: 0, to: 1 }).value));
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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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.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
Use spherical coordinates to find the volume of a ball of radius 2.
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";
const r = symbolic.integrate("rho^2", "rho", { from: 0, to: 2 }).value; // 8/3
const p = symbolic.integrate("sin(phi)", "phi", { from: 0, to: "pi" }).value; // 2
console.log(String(symbolic.simplify(`(${r})*(${p})*2*pi`)));
Checked output
32*pi/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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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.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
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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
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.96 ms on Node.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.changeOfVariables · 2 passing test cases, 3 distinct argument descriptions
"x^2 + y^2", ["x", "y"] (n=2), {x="r*cos(t)", y="r*sin(t)"}, ["r", "t"] (n=2), {r=[0, 1] (n=2), t=[0, "2*pi"] (n=2)} · polar coordinates show the factor r
"x + y", ["x", "y"] (n=2), {x="u + v", y="u - v"}, ["u", "v"] (n=2), {u=[0, 1] (n=2), v=[0, 1] (n=2)} or "x + y", ["x", "y"] (n=2), {x="2*u", y="3*v"}, ["u", "v"] (n=2), {u=[0, 1] (n=2), v=[0, 1] (n=2)}, {original={x=array[2], y=array[2]}} · a negative determinant is used by its size, and the direct integral agrees
Day 23 / 40 · Multiple integrals
Area scaling
Direct calculation@ratmath/linalg
Problem
Under x=2u and y=3v, what area corresponds to the unit square?
Worked solution
The determinant of the transformation is 6. Multiply the original area by its absolute value.
Using RatMath
Enter the matrix one row at a time, preserving the order of the unknowns. Use the result with the original matrix to check the required relation.
JavaScript module
import * as linalg from "@ratmath/linalg";
console.log(String(linalg.det([[2,0],[0,3]]).exact()));
Checked output
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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
For this problem type. Hand calculations usually use 2–5 rows and columns with small integer or rational entries. Include deficient rank as a separate case.
Focal example. The code above passed its displayed check in 0.448 ms on Node.
Same API, measured input family.linalg.det.exact · square matrix side. Baseline test points across courses 1, 2, 3, 5, 10. Dense matrix I+J has eigenvalues 1 (n−1 times) and n+1.
Practical limit. Largest passing sample 200 (383 ms, 131.8 MiB peak process RSS). The first sampled passing call above 100 ms used 200 (383 ms). The runs did not locate a ceiling for this family. Even with small dimensions, large integer minors increase the cost of exact elimination. The dense structured fixture has small entries.
Measured times, memory and outcomes
square matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.731
76.1
2
Baseline
Passed
0.810
74.8
3
Baseline
Passed
0.876
75.2
5
Baseline
Passed
1.32
75.4
10
Baseline
Passed
1.58
76.1
25
Stretch
Passed
7.10
77.5
50
Stretch
Passed
21.28
81.7
100
Stretch
Passed
67.11
90.3
200
Stretch
Passed
383
131.8
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.
linalg.det · 19 passing test cases, 22 distinct argument descriptions
The x and y dimensions contribute one each. The integral of 2z from 0 to 1 is 1.
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*(1/2)`));
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. Two or three integration variables with elementary bounds; one change of variables and its Jacobian.
Focal example. The code above passed its displayed check in 0.134 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.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
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 P = analytic.potential(["y", "x"], ["x", "y"]);
console.log([P.conservative, String(P.potential), P.value([1, 2], [0, 0])]);
Checked output
[true, "x*y", 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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
Focal example. The code above passed its displayed check in 1.30 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.
analytic.potential · 3 passing test cases, 3 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 analytic from "@ratmath/analytic";
// the parameter interval must be rational, so t runs over [0, 1] and the angle is 2πt
console.log(
analytic.lineIntegral(["-y", "x"], ["x", "y"], { x: "cos(2*pi*t)", y: "sin(2*pi*t)" }, [0, 1]).exact()
);
Checked output
6.2831853071795[8289406:9005979]
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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
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 585 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.lineIntegral · 1 passing test case, 2 distinct argument descriptions
["-y", "x"] (n=2), ["x", "y"] (n=2), {x="cos(t)", y="sin(t)"}, [0, 1] (n=2) or "1", ["x", "y"] (n=2), {x="3t", y="4t"}, [0, 1] (n=2) · work around the unit circle
Day 27 / 40 · Vector fields
Green's theorem
Direct calculation@ratmath/analytic
Problem
Use Green's theorem for around the unit square , counterclockwise.
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 analytic from "@ratmath/analytic";
const g = analytic.greens(["x^2*y", "x"], ["x", "y"], { x: [0, 1], y: [0, 1] });
console.log([g.agree, g.right.value]);
Checked output
[true, 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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
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.42 ms on Node.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.greens · 2 passing test cases, 5 distinct argument descriptions
["-y/2", "x/2"] (n=2), ["x", "y"] (n=2), {x=[0, 1] (n=2), y=[0, "1 - x"] (n=2)} or ["x^2", "y^2"] (n=2), ["x", "y"] (n=2), {x=[0, 1] (n=2), y=[0, 2] (n=2)}, {flux=true} · area by a line integral, and the flux form
Day 28 / 40 · Vector fields
Divergence and curl
Direct calculation@ratmath/analytic
Problem
For find and .
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 analytic from "@ratmath/analytic";
const F = ["x*y", "y*z", "z*x"], V = ["x", "y", "z"];
console.log([String(analytic.divergence(F, V)), analytic.curl(F, V).map(String)]);
Checked output
["y + z + x", ["-y", "-z", "-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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
Focal example. The code above passed its displayed check in 0.277 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.
analytic.divergence · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.contourIntegral("1/z", complex.Contour.circle(0, 1))));
Checked output
0 + 6.2831853072i ± 7.9e-17
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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
For this problem type. Use one oriented contour and roughly 1–4 candidate poles or zeros, commonly of order 1–3. Their separation from the contour matters.
Focal example. The code above passed its displayed check in 78.50 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.complex.residue · pole location. Baseline test points across courses 0, 1, 2, 5. The coefficient of (z−a)^−1 in 1/(z−a) is exactly one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000 (111 ms, 91.4 MiB peak process RSS). The first sampled passing call above 100 ms used 0 (141 ms). The runs did not locate a ceiling for this family. This fixture has one isolated simple pole. Nearby singularities, high order and cancellation can drastically increase the enclosure cost.
Measured times, memory and outcomes
pole location · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
141
92.4
1
Baseline
Passed
163
90
2
Baseline
Passed
144
90.1
5
Baseline
Passed
157
92.2
50
Stretch
Passed
160
90.4
1,000
Stretch
Passed
132
91.3
1,000,000
Stretch
Passed
111
91.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.
complex.contourIntegral · 6 passing test cases, 7 distinct argument descriptions
If the line integral of F along C is 7, what happens on the reversed curve?
Worked solution
Reversing the velocity while retracing the curve negates the work.
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)*7`));
Checked output
-7
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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
Focal example. The code above passed its displayed check in 0.133 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.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
Does zero curl on the punctured plane guarantee a global potential?
Worked solution
No. The field (−y,x)/(x²+y²) has circulation 2π around the unit circle. The usual simply connected domain hypothesis matters.
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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
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 32 / 40 · Vector fields
Fundamental theorem
Direct calculation@ratmath/symbolic
Problem
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(String(symbolic.leibniz("cos(t)", "t", "0", "x^2").value));
Checked output
2*x*cos(x^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. Two- or three-component fields and one piecewise smooth curve, often a closed loop.
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.73 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.leibniz · 2 passing test cases, 3 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. A two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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,795 ms on Node.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.surfaceIntegral · 1 passing test case, 2 distinct argument descriptions
["0", "0", "z + x"] (n=3), ["x", "y", "z"] (n=3), {x="u", y="w", z="1"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)} or "1", ["x", "y", "z"] (n=3), {x="cos(u)", y="sin(u)", z="w"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)}, {digits=4} · flux through a flat patch and the area of a cylinder
Day 34 / 40 · Surfaces and flux
Surface area
Direct calculation@ratmath/analytic
Problem
Find the area of the part of below .
Worked solution
.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
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 two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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 18,961 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.surfaceIntegral · 1 passing test case, 2 distinct argument descriptions
["0", "0", "z + x"] (n=3), ["x", "y", "z"] (n=3), {x="u", y="w", z="1"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)} or "1", ["x", "y", "z"] (n=3), {x="cos(u)", y="sin(u)", z="w"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)}, {digits=4} · flux through a flat patch and the area of a cylinder
Day 35 / 40 · Surfaces and flux
First fundamental form
Direct calculation@ratmath/analytic
Problem
Find for the torus .
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 analytic from "@ratmath/analytic";
const f = analytic.surface(["(2 + cos(v))*cos(u)", "(2 + cos(v))*sin(u)", "sin(v)"], ["u", "v"]).first();
console.log([f.E, f.F, f.G].map(String));
Checked output
["cos(v)^2 + 4*cos(v) + 4", "0", "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 two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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 10.71 ms on Node.
Same API, measured input family.analytic.surface · coefficient of the mixed term. Baseline test points across courses 1, 2, 3, 5. The graph z=k u v at the origin has Gaussian curvature −k².
Practical limit. Largest passing sample 100 (5.09 ms, 76.7 MiB peak process RSS). The runs did not locate a ceiling for this family. The patch must be regular at the evaluation point. Small metric determinants or high expression complexity make geometry more sensitive or costly.
Measured times, memory and outcomes
coefficient of the mixed term · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
4.66
76.2
2
Baseline
Passed
14.67
76
3
Baseline
Passed
7.08
77.2
5
Baseline
Passed
5.04
76.2
10
Stretch
Passed
4.97
76.7
50
Stretch
Passed
4.73
76.7
100
Stretch
Passed
5.09
76.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.
analytic.surface · 1 passing test case, 4 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. A two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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 261 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.surface · coefficient of the mixed term. Baseline test points across courses 1, 2, 3, 5. The graph z=k u v at the origin has Gaussian curvature −k².
Practical limit. Largest passing sample 100 (5.09 ms, 76.7 MiB peak process RSS). The runs did not locate a ceiling for this family. The patch must be regular at the evaluation point. Small metric determinants or high expression complexity make geometry more sensitive or costly.
Measured times, memory and outcomes
coefficient of the mixed term · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
4.66
76.2
2
Baseline
Passed
14.67
76
3
Baseline
Passed
7.08
77.2
5
Baseline
Passed
5.04
76.2
10
Stretch
Passed
4.97
76.7
50
Stretch
Passed
4.73
76.7
100
Stretch
Passed
5.09
76.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.
analytic.surface · 1 passing test case, 4 distinct argument descriptions
Find the upward flux of (0,0,2) through the unit square in the plane z=0.
Worked solution
The normal is (0,0,1) so the flux density is 2. Integrate this constant over unit area.
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*1*1`));
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. A two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
Focal example. The code above passed its displayed check in 0.157 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
Viewed from above, which way must one traverse the boundary of an upward-oriented horizontal disk in Stokes’ theorem?
Worked solution
Counterclockwise. Curl the fingers of the right hand with the thumb pointing along the upward normal.
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 two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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 · Surfaces and flux
Outward flux
Direct calculation@ratmath/core
Problem
For F=(x,y,z), find outward flux through the boundary of the unit cube.
Worked solution
Divergence is 3 everywhere. Integrate it over volume one.
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`3*1`));
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. A two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
Focal example. The code above passed its displayed check in 0.060 ms on Node.
Same arithmetic expression. Replaced its first numeral 3 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
On an upward-oriented disk, which way must its positively oriented boundary travel as seen from above?
Worked solution
The right-hand rule gives counterclockwise traversal. Reversing the surface normal reverses the boundary direction.
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 two-parameter patch in three-space or a small collection forming a boundary; orientation and boundary terms matter.
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.