#cd-remainder-theorem-calculator {
–cd-rt-bg: #f6f8fb;
–cd-rt-card: #ffffff;
–cd-rt-text: #172033;
–cd-rt-muted: #5d6b82;
–cd-rt-line: #d9e0ea;
–cd-rt-primary: #2457d6;
–cd-rt-primary-dark: #173e9f;
–cd-rt-soft: #eef4ff;
–cd-rt-error: #b42318;
–cd-rt-success: #137333;
font-family: Arial, Helvetica, sans-serif;
color: var(–cd-rt-text);
background: var(–cd-rt-bg);
padding: 18px;
border-radius: 10px;
box-sizing: border-box;
line-height: 1.55;
}#cd-remainder-theorem-calculator * {
box-sizing: border-box;
}#cd-remainder-theorem-calculator .cd-rt-tool {
background: var(–cd-rt-card);
border: 1px solid var(–cd-rt-line);
border-radius: 10px;
padding: 20px;
box-shadow: 0 8px 24px rgba(20, 33, 61, 0.06);
margin-bottom: 22px;
}#cd-remainder-theorem-calculator h2 {
margin: 0 0 8px;
font-size: 1.7rem;
line-height: 1.25;
}#cd-remainder-theorem-calculator h3 {
margin: 22px 0 10px;
font-size: 1.2rem;
line-height: 1.3;
}#cd-remainder-theorem-calculator p {
margin: 0 0 12px;
color: var(–cd-rt-muted);
}#cd-remainder-theorem-calculator .cd-rt-label-row {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
margin: 10px 0 16px;
}#cd-remainder-theorem-calculator .cd-rt-badge {
display: inline-flex;
align-items: center;
border-radius: 999px;
background: var(–cd-rt-soft);
color: var(–cd-rt-primary-dark);
font-size: 0.85rem;
font-weight: 700;
padding: 5px 10px;
}#cd-remainder-theorem-calculator .cd-rt-grid {
display: grid;
grid-template-columns: 1.5fr 0.7fr 0.7fr;
gap: 14px;
align-items: end;
}#cd-remainder-theorem-calculator .cd-rt-field label {
display: block;
font-weight: 700;
margin-bottom: 6px;
color: var(–cd-rt-text);
}#cd-remainder-theorem-calculator .cd-rt-field input,
#cd-remainder-theorem-calculator .cd-rt-field select {
width: 100%;
min-height: 44px;
border: 1px solid var(–cd-rt-line);
border-radius: 8px;
padding: 10px 12px;
font-size: 1rem;
background: #fff;
color: var(–cd-rt-text);
}#cd-remainder-theorem-calculator .cd-rt-help {
display: block;
margin-top: 5px;
color: var(–cd-rt-muted);
font-size: 0.9rem;
}#cd-remainder-theorem-calculator .cd-rt-buttons {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 16px;
}#cd-remainder-theorem-calculator button.cd-rt-btn {
border: 0;
border-radius: 8px;
padding: 11px 15px;
min-height: 44px;
font-size: 0.98rem;
font-weight: 700;
cursor: pointer;
transition: background 0.15s ease, transform 0.15s ease;
}#cd-remainder-theorem-calculator button.cd-rt-btn:active {
transform: translateY(1px);
}#cd-remainder-theorem-calculator .cd-rt-primary {
background: var(–cd-rt-primary);
color: #fff;
}#cd-remainder-theorem-calculator .cd-rt-primary:hover {
background: var(–cd-rt-primary-dark);
}#cd-remainder-theorem-calculator .cd-rt-secondary {
background: #e9edf5;
color: var(–cd-rt-text);
}#cd-remainder-theorem-calculator .cd-rt-secondary:hover {
background: #dce3ee;
}#cd-remainder-theorem-calculator .cd-rt-result {
margin-top: 18px;
border: 1px solid #c9d8ff;
background: linear-gradient(180deg, #f7faff 0%, #eef4ff 100%);
border-radius: 10px;
padding: 16px;
}#cd-remainder-theorem-calculator .cd-rt-result-main {
font-size: 2rem;
font-weight: 800;
color: var(–cd-rt-primary-dark);
line-height: 1.2;
word-break: break-word;
}#cd-remainder-theorem-calculator .cd-rt-result-sub {
margin-top: 8px;
color: var(–cd-rt-text);
}#cd-remainder-theorem-calculator .cd-rt-error {
display: none;
margin-top: 12px;
color: var(–cd-rt-error);
background: #fff1f0;
border: 1px solid #ffd1cc;
border-radius: 8px;
padding: 10px 12px;
font-weight: 700;
}#cd-remainder-theorem-calculator .cd-rt-section {
background: var(–cd-rt-card);
border: 1px solid var(–cd-rt-line);
border-radius: 10px;
padding: 18px;
margin: 16px 0;
}#cd-remainder-theorem-calculator .cd-rt-section ul,
#cd-remainder-theorem-calculator .cd-rt-section ol {
margin: 8px 0 0 22px;
padding: 0;
color: var(–cd-rt-muted);
}#cd-remainder-theorem-calculator .cd-rt-section li {
margin-bottom: 8px;
}#cd-remainder-theorem-calculator .cd-rt-formula {
background: #f8fafc;
border: 1px solid var(–cd-rt-line);
border-radius: 8px;
padding: 12px;
color: var(–cd-rt-text);
overflow-x: auto;
font-weight: 700;
}#cd-remainder-theorem-calculator .cd-rt-steps {
background: #fbfcff;
border-left: 4px solid var(–cd-rt-primary);
padding: 12px;
border-radius: 8px;
color: var(–cd-rt-muted);
white-space: pre-wrap;
overflow-wrap: anywhere;
}#cd-remainder-theorem-calculator details {
border-top: 1px solid var(–cd-rt-line);
padding: 12px 0;
}#cd-remainder-theorem-calculator details:first-of-type {
border-top: 0;
}#cd-remainder-theorem-calculator summary {
cursor: pointer;
font-weight: 700;
color: var(–cd-rt-text);
}#cd-remainder-theorem-calculator a {
color: var(–cd-rt-primary);
text-decoration: underline;
}@media (max-width: 760px) {
#cd-remainder-theorem-calculator {
padding: 12px;
}#cd-remainder-theorem-calculator .cd-rt-tool,
#cd-remainder-theorem-calculator .cd-rt-section {
padding: 15px;
}#cd-remainder-theorem-calculator .cd-rt-grid {
grid-template-columns: 1fr;
}#cd-remainder-theorem-calculator h2 {
font-size: 1.45rem;
}#cd-remainder-theorem-calculator .cd-rt-result-main {
font-size: 1.55rem;
}#cd-remainder-theorem-calculator button.cd-rt-btn {
width: 100%;
}
}
What the Result Means
The remainder theorem says that if a polynomial P(x) is divided by x – c, the remainder is P(c). This calculator substitutes your c value into the polynomial and also shows the Horner method steps used to get the result.
Synthetic evaluation steps will appear here after calculation.
Remainder Theorem Formula
If P(x) is divided by x – c, then:
Remainder = P(c)
For a polynomial such as ax^3 + bx^2 + cx + d, substitute the divisor value into x. If the divisor is x – 2, use x = 2. If the divisor is x + 3, rewrite it as x – (-3), so use x = -3.
How to Use This Calculator
- Write the polynomial coefficients in order from the highest power down to the constant term.
- Use zero for any missing power. For example, x^3 + 4 has coefficients 1, 0, 0, 4.
- Enter the c value from the divisor x – c.
- Click Calculate Remainder to evaluate P(c).
- Read the remainder and the step-by-step synthetic evaluation below the tool.
Worked Example
Find the remainder when 2x^3 – 3x^2 + 5 is divided by x – 2.
P(2) = 2(2^3) – 3(2^2) + 0(2) + 5 = 16 – 12 + 0 + 5 = 9
The remainder is 9. If your polynomial has a missing x term, you still enter its coefficient as 0 so the powers stay in the correct order.
Common Use Cases
- Checking the remainder of polynomial division without doing full long division.
- Testing whether x – c is a factor of a polynomial. If P(c) = 0, then x – c is a factor.
- Solving algebra homework problems that ask for the remainder only.
- Comparing synthetic substitution with polynomial long division.
Common Mistakes
- Entering coefficients in the wrong order. They must go from highest degree to constant term.
- Skipping missing powers instead of entering 0.
- Using the wrong sign for the divisor. For x + 4, the c value is -4.
- Confusing the quotient with the remainder. This calculator focuses on the remainder value P(c).
Limitations
This tool handles real-number coefficients, decimals, and simple fractions such as 1/2. It is designed for division by a linear divisor in the form x – c. It does not perform full polynomial division by quadratic or higher-degree divisors.
FAQ
What is the remainder theorem?
The remainder theorem states that the remainder when P(x) is divided by x – c is equal to P(c).
How do I enter x + 3 as the divisor?
Rewrite x + 3 as x – (-3), then enter -3 as the c value.
Can this calculator show if something is a factor?
Yes. If the remainder is 0, then x – c is a factor of the polynomial.
Why do I need to enter zeros for missing terms?
Zeros keep each coefficient aligned with the correct power of x. Without them, the calculator may read the polynomial as a different expression.
Does the calculator support fractions?
Yes, you can enter simple fractions such as 3/4 or -5/2 in the coefficient list or c value field.
(function () {
function startRemainderTool() {
try {
var root = document.getElementById(“cd-remainder-theorem-calculator”);
if (!root) {
return;
}var coefficientInput = root.querySelector(“#cd-rt-coefficients”);
var cInput = root.querySelector(“#cd-rt-cvalue”);
var decimalsSelect = root.querySelector(“#cd-rt-decimals”);
var calculateButton = root.querySelector(“#cd-rt-calculate”);
var exampleOneButton = root.querySelector(“#cd-rt-example-one”);
var exampleTwoButton = root.querySelector(“#cd-rt-example-two”);
var copyButton = root.querySelector(“#cd-rt-copy”);
var clearButton = root.querySelector(“#cd-rt-clear”);
var errorBox = root.querySelector(“#cd-rt-error”);
var mainResult = root.querySelector(“#cd-rt-main”);
var subResult = root.querySelector(“#cd-rt-sub”);
var stepsBox = root.querySelector(“#cd-rt-steps”);function showError(message) {
errorBox.textContent = message;
errorBox.style.display = “block”;
}function hideError() {
errorBox.textContent = “”;
errorBox.style.display = “none”;
}function parseNumberToken(token) {
var cleaned = String(token).trim();
if (cleaned === “”) {
return { ok: false, value: 0 };
}var slashParts = cleaned.split(“/”);
if (slashParts.length === 2) {
var top = Number(slashParts[0].trim());
var bottom = Number(slashParts[1].trim());
if (Number.isFinite(top)) {
if (Number.isFinite(bottom)) {
if (bottom !== 0) {
return { ok: true, value: top / bottom };
}
}
}
return { ok: false, value: 0 };
}if (slashParts.length > 2) {
return { ok: false, value: 0 };
}var numericValue = Number(cleaned);
if (Number.isFinite(numericValue)) {
return { ok: true, value: numericValue };
}return { ok: false, value: 0 };
}function parseCoefficients(text) {
var parts = String(text).split(“,”);
var values = [];
var index = 0;while (index < parts.length) {
var parsed = parseNumberToken(parts[index]);
if (!parsed.ok) {
return { ok: false, values: [], message: "Please enter valid coefficients separated by commas. Decimals and simple fractions are allowed." };
}
values.push(parsed.value);
index = index + 1;
}if (values.length 20) {
return { ok: false, values: [], message: “Please use 20 coefficients or fewer for a readable result.” };
}return { ok: true, values: values, message: “” };
}function roundValue(value, decimals) {
var factor = Math.pow(10, decimals);
return Math.round(value * factor) / factor;
}function formatNumber(value, decimals) {
var rounded = roundValue(value, decimals);
if (Math.abs(rounded) < 1e-12) {
rounded = 0;
}
return String(rounded);
}function polynomialText(coefficients) {
var degree = coefficients.length – 1;
var terms = [];
var i = 0;while (i < coefficients.length) {
var coefficient = coefficients[i];
var power = degree – i;if (coefficient !== 0) {
var sign = coefficient 1) {
if (absValue === 1) {
coeffText = “x^” + power;
} else {
coeffText = coeffText + “x^” + power;
}
} else if (power === 1) {
if (absValue === 1) {
coeffText = “x”;
} else {
coeffText = coeffText + “x”;
}
}if (terms.length === 0) {
if (sign === “-“) {
terms.push(“-” + coeffText);
} else {
terms.push(coeffText);
}
} else {
terms.push(” ” + sign + ” ” + coeffText);
}
}i = i + 1;
}if (terms.length === 0) {
return “0”;
}return terms.join(“”);
}function calculate() {
hideError();var parsedCoefficients = parseCoefficients(coefficientInput.value);
var parsedC = parseNumberToken(cInput.value);
var decimals = Number(decimalsSelect.value);if (!parsedCoefficients.ok) {
showError(parsedCoefficients.message);
return;
}if (!parsedC.ok) {
showError(“Please enter a valid c value. For x – 2 enter 2, and for x + 3 enter -3.”);
return;
}if (!Number.isFinite(decimals)) {
showError(“Please choose a valid rounding option.”);
return;
}var coefficients = parsedCoefficients.values;
var c = parsedC.value;
var running = coefficients[0];
var syntheticLines = [];
var quotient = [];syntheticLines.push(“Polynomial: P(x) = ” + polynomialText(coefficients));
syntheticLines.push(“Divisor form: x – c, where c = ” + formatNumber(c, decimals));
syntheticLines.push(“Start with the leading coefficient: ” + formatNumber(running, decimals));var i = 1;
while (i < coefficients.length) {
quotient.push(running);
var multiplied = running * c;
var nextValue = multiplied + coefficients[i];
syntheticLines.push("Step " + i + ": (" + formatNumber(running, decimals) + " x " + formatNumber(c, decimals) + ") + " + formatNumber(coefficients[i], decimals) + " = " + formatNumber(nextValue, decimals));
running = nextValue;
i = i + 1;
}var remainder = running;
var formattedRemainder = formatNumber(remainder, decimals);
var divisorText = c < 0 ? "x + " + formatNumber(Math.abs(c), decimals) : "x – " + formatNumber(c, decimals);mainResult.textContent = "Remainder: " + formattedRemainder;
subResult.textContent = "P(" + formatNumber(c, decimals) + ") = " + formattedRemainder + ", so the remainder when P(x) is divided by " + divisorText + " is " + formattedRemainder + ".";if (Math.abs(remainder) < 1e-12) {
syntheticLines.push("Because the remainder is 0, " + divisorText + " is a factor of the polynomial.");
} else {
syntheticLines.push("Final remainder: " + formattedRemainder);
}stepsBox.textContent = syntheticLines.join("\n");
}function setExampleOne() {
coefficientInput.value = "2, -3, 0, 5";
cInput.value = "2";
decimalsSelect.value = "2";
calculate();
}function setExampleTwo() {
coefficientInput.value = "1, 0, -7, 6";
cInput.value = "-3";
decimalsSelect.value = "2";
calculate();
}function copyResult() {
hideError();
var text = mainResult.textContent + " " + subResult.textContent;
if (navigator.clipboard) {
navigator.clipboard.writeText(text).then(function () {
copyButton.textContent = "Copied";
window.setTimeout(function () {
copyButton.textContent = "Copy Result";
}, 1400);
}).catch(function () {
showError("Copy failed. You can still select the result text manually.");
});
} else {
showError("Copy is not available in this browser. You can select the result text manually.");
}
}function clearTool() {
hideError();
coefficientInput.value = "";
cInput.value = "";
decimalsSelect.value = "2";
mainResult.textContent = "Remainder: –";
subResult.textContent = "Enter a polynomial and a c value, then calculate the remainder.";
stepsBox.textContent = "Synthetic evaluation steps will appear here after calculation.";
}calculateButton.addEventListener("click", calculate);
exampleOneButton.addEventListener("click", setExampleOne);
exampleTwoButton.addEventListener("click", setExampleTwo);
copyButton.addEventListener("click", copyResult);
clearButton.addEventListener("click", clearTool);calculate();
} catch (toolError) {
var fallbackRoot = document.getElementById("cd-remainder-theorem-calculator");
if (fallbackRoot) {
var fallbackError = fallbackRoot.querySelector("#cd-rt-error");
if (fallbackError) {
fallbackError.textContent = "The calculator could not start. Please refresh the page and try again.";
fallbackError.style.display = "block";
}
}
}
}if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", startRemainderTool);
} else {
startRemainderTool();
}
})();