Series Partial Sum Calculator
Adding the first 5 terms of 1/k^2 gives 1.463611111111. Type any term formula in k, say how many terms to add and where to start, and every addend is listed for checking. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 5
- Start index
- 1
- Precision
- 12
- End index
- 5
- First term
- 1
- Last term
- 0.04
- Partial sum
- 1.4636111111
A partial sum turns a sequence rule into a concrete number by adding a finite run of its terms. Enter an explicit formula for the term at index k, choose how many terms to include, and optionally select the first index and output precision. The calculator safely parses the formula, substitutes each consecutive integer index, and adds the resulting values with compensated summation. It supports ordinary arithmetic, powers, parentheses, mathematical constants, and common single-argument functions without executing user code. Everything is deterministic and runs without a network call, model, random source, or clock.
Describe the general term and choose the first n terms
A series begins with a sequence, and a sequence needs a rule for its individual terms. In this calculator the letter k is the integer index. For example, the formula 1/k^2 describes the reciprocal-square sequence, while (-1)^(k+1)/k describes alternating harmonic terms when the starting index is 1.
The required n field tells the calculator how many consecutive values to add; it is a count, not the final index. Use explicit multiplication signs, such as 2*k rather than 2k. Available operators are addition, subtraction, multiplication, division, and exponentiation with ^.
Parentheses control grouping. Constants pi and e and the functions abs, sqrt, sin, cos, tan, exp, ln, and base-ten log are supported. The expression is parsed as mathematics rather than evaluated as JavaScript, so property access, assignments, and arbitrary code are never accepted.
Keep the formula defined at every selected index: 1/k cannot begin at zero, and sqrt(k) needs nonnegative selected indices if you expect real-valued results.
Understand how the partial sum is calculated
After validating the formula and bounds, the engine parses the expression once into a small syntax tree. Every term must be a finite real JavaScript number. The addition uses a compensated algorithm that tracks small rounding errors lost during ordinary floating-point addition.
This is especially useful when a series mixes values with very different magnitudes or alternates between positive and negative terms. Precision controls response formatting rather than the mathematics performed inside the loop: evaluation and accumulation use full available binary floating-point precision, then returned numbers are stabilized to the requested decimal places. Requests of fifty terms or fewer include a terms array so you can audit every addend.
Identical inputs follow identical parsing, evaluation, addition, and rounding paths.
Check results, convergence, and practical limitations
A partial sum is always tied to its chosen n and starting index. It is not automatically the value of an infinite series, even when a familiar convergence formula exists. To explore convergence, calculate several partial sums with increasing n and compare how the totals change.
A reciprocal-square series should settle gradually, while the harmonic series 1/k continues to grow even though later terms become small. Alternating series may approach a limit by oscillating around it, so compare successive even and odd counts rather than trusting one rounded display. Remember that this calculator works with finite-precision real numbers, not symbolic fractions or proofs.
Very large powers, severe cancellation, and values near function-domain boundaries can lose accuracy even with compensated addition. Adjust precision only to display meaningful digits; adding more displayed decimals cannot recover information already unavailable in floating-point arithmetic. The free browser path is convenient for lessons, homework checks, and quick numerical experiments.
Invalid formulas are rejected before a useful result is returned. When a rigorous error bound or a symbolic closed form is required, use this numeric partial sum as a check alongside an appropriate analytic convergence argument.
What you can do with it
Calculus homework checks
Evaluate the first n terms of reciprocal, alternating, power, or trigonometric series and compare the numeric result with a hand calculation.
Convergence experiments
Repeat a formula with increasing n to observe whether partial sums stabilize, oscillate, or continue growing.
Worksheet and tutoring tools
Generate deterministic answer keys from explicit k-term formulas while retaining the index range and inspectable terms for small exercises.
FAQ
What does n mean in a partial sum?
It is the number of consecutive terms to add.
Which variable should I use in the term formula?
Use k as the integer index, for example 1/k^2 or (-1)^(k+1)/k.
Can I use mathematical functions and constants?
Yes. The parser supports pi, e, abs, sqrt, sin, cos, tan, exp, ln, and base-ten log, along with standard arithmetic and powers.
Does this calculate the sum of an infinite series?
No. It numerically adds exactly n terms. Partial sums can help investigate convergence, but they do not prove or automatically return an infinite-series limit.
Why was my formula rejected at one index?
Every selected term must be finite and real.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/calculus/partial-sum-series \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"formula":"1 / k^2","n":5}'const res = await fetch("https://api.kit.forhosting.com/calculus/partial-sum-series", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"formula": "1 / k^2",
"n": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/calculus/partial-sum-series",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"formula": "1 / k^2",
"n": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/calculus/partial-sum-series", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"formula":"1 / k^2","n":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"formula":"1 / k^2","n":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/calculus/partial-sum-series", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"formula": "1 / k^2",
"n": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "calculus.partial_sum_series",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The response identifies the index range, first and last terms, partial sum, and—when the request is reasonably small—the complete term list.
Describe the general term and choose the first n terms
With n equal to 5 and start_index equal to 1, the included indices are 1, 2, 3, 4, and 5. If start_index is 0, the same count covers 0 through 4. This distinction prevents a common off-by-one error.
Understand how the partial sum is calculated
It then walks from start_index through start_index plus n minus one, substitutes each integer for k, evaluates the term, and adds it to a running total. Division by zero, a logarithm outside its real domain, an overflowing power, or any other non-finite result stops the request with invalid_input and identifies the troublesome index. Larger requests omit that optional array to keep the response compact, while still returning the first term, last term, start and end indices, count, and final partial_sum. The maximum of ten thousand terms keeps browser and Worker execution predictably bounded.
Check results, convergence, and practical limitations
The returned first_term, last_term, end_index, and optional terms array are useful checks that the intended indexing and signs were applied. API calls begin at $0.002 per successful request and suit worksheet generators, tutoring systems, and reproducible calculation pipelines.