Calculus/Cal 2·distance-traveled
Distance Traveled
Calculate the total distance traveled by a particle given its velocity function over a specified time interval.
Math animationCalculus/Cal 2 · distance-traveled
✓ All 2 test cases pass.
Inputs
Test cases
These cases run live in your browser every time the page loads. If any fail, the calculator is broken — file an issue.
| # | Inputs | Expected | Got | Status |
|---|---|---|---|---|
| 1 | {"velocity_function":"6*t - 6","time_start":0,"time_end":3} | 15 | 15 | ✓ |
| 2 | {"velocity_function":"t^2 - 4*t + 3","time_start":0,"time_end":4} | 4 | 4.000000000000003 | ✓ |
APIDeveloper APICall this calculator from codeexpand ↓
Endpoint
POST
/api/calculators/calculus-cal-2/distance-traveled/computeInputs (3)
velocity_functionexpressiondefault"6*t - 6"time_startnumberdefault0time_endnumberdefault3
Example
curl -sX POST http://localhost:3001/api/calculators/calculus-cal-2/distance-traveled/compute \
-H "Content-Type: application/json" \
-d '{"inputs":{"velocity_function":"6*t - 6","time_start":0,"time_end":3}}'Try it live
Edit the body below, then click Call API.Request body
Response
(click Call API to see the response)Source: Pattern from: Calculus II Final Exam Review.pdf. Reproduces a standard distance-traveled computation; problem text paraphrased.
AI disclosure: Calculator code generated by openai/gpt-4o-mini-2024-07-18; verified by 2 test cases.