function calculateConvergence() {
var firstTermInput = document.getElementById('firstTerm').value;
var commonRatioInput = document.getElementById('commonRatio').value;
var resultDiv = document.getElementById('resultOutput');
var a = parseFloat(firstTermInput);
var r = parseFloat(commonRatioInput);
if (isNaN(a) || isNaN(r)) {
resultDiv.innerHTML = 'Please enter valid numbers for both the First Term and Common Ratio.';
return;
}
var absR = Math.abs(r);
var resultHTML = ";
if (absR < 1) {
var sum = a / (1 – r);
resultHTML = 'The geometric series with First Term (a) = ' + a + ' and Common Ratio (r) = ' + r + ' converges.';
resultHTML += 'The sum of the series is: ' + sum.toFixed(6) + '';
} else {
resultHTML = 'The geometric series with First Term (a) = ' + a + ' and Common Ratio (r) = ' + r + ' diverges.';
resultHTML += 'This is because the absolute value of the common ratio (|r| = ' + absR.toFixed(6) + ') is greater than or equal to 1.';
}
resultDiv.innerHTML = resultHTML;
}
Understanding Geometric Series Convergence
A geometric series is a series with a constant ratio between successive terms. It takes the general form:
a + ar + ar2 + ar3 + ...
where 'a' is the first term and 'r' is the common ratio. The behavior of a geometric series – whether it adds up to a finite value (converges) or grows infinitely large (diverges) – depends entirely on the value of its common ratio 'r'.
When Does a Geometric Series Converge?
A geometric series converges if and only if the absolute value of its common ratio 'r' is less than 1. Mathematically, this is expressed as |r| < 1 (or -1 < r < 1).
If this condition is met, the sum of an infinite geometric series can be calculated using the formula:
Sum = a / (1 - r)
where 'a' is the first term and 'r' is the common ratio.
When Does a Geometric Series Diverge?
If the absolute value of the common ratio 'r' is greater than or equal to 1 (i.e., |r| ≥ 1), the terms of the series either grow larger and larger, or they oscillate without settling, causing the sum to approach infinity. In such cases, the series is said to diverge, and it does not have a finite sum.
How to Use the Calculator
Our Geometric Series Convergence Calculator simplifies the process of determining convergence and finding the sum:
First Term (a): Enter the initial term of your geometric series. This is the first number in the sequence.
Common Ratio (r): Input the common ratio. This is the number you multiply by to get from one term to the next.
Calculate Convergence: Click the button, and the calculator will instantly tell you if the series converges or diverges. If it converges, it will also provide the sum of the infinite series.
Examples:
Example 1: Convergent Series
First Term (a): 1
Common Ratio (r): 0.5
Calculation: Since |0.5| < 1, the series converges.
Sum:1 / (1 - 0.5) = 1 / 0.5 = 2
The series is 1 + 0.5 + 0.25 + 0.125 + ..., and its sum is 2.
Example 2: Divergent Series
First Term (a): 3
Common Ratio (r): 2
Calculation: Since |2| ≥ 1, the series diverges.
The series is 3 + 6 + 12 + 24 + ..., which grows infinitely.
Example 3: Convergent Series with Negative Ratio
First Term (a): 10
Common Ratio (r): -0.8
Calculation: Since |-0.8| < 1, the series converges.