Calculadora do Problema Diamante
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
x = (s ± √(s² − 4p)) / 2
About this calculator
The Diamond Problem Calculator solves a specific algebraic problem: given the sum (s) and product (p) of two numbers, find those numbers. It is often used to factor quadratic trinomials or to understand the relationship between roots and coefficients of a quadratic equation. The tool applies the quadratic formula directly: x = (s ± √(s² − 4p)) / 2. This is equivalent to solving the equation x² - s x + p = 0, where the roots are the desired numbers.
How it works: you enter the sum and product values. The calculator checks if the discriminant (s² - 4p) is non-negative. If positive, it finds two distinct real roots; if zero, a double root. If the discriminant is negative, it warns that no real numbers exist. The result is presented as the two numbers that satisfy the given conditions.
When to use? In situations where you know the sum and product of two quantities but not the individual values. For example, in polynomial factoring problems, optimization questions, or geometric contexts (like finding the dimensions of a rectangle given perimeter and area). Also useful for algebra students who need to quickly verify their manual solutions.
Important precautions: ensure the sum and product values are correct, especially the sign. Remember that the formula assumes the equation is x² - s x + p = 0. If the sum is, say, -5 and product 6, the numbers will be -2 and -3. The calculator only handles real numbers; for complex roots, no result is given. Always check that the discriminant is non-negative before relying on the result.
Frequently asked questions
What is the diamond problem?
It is an algebraic problem where you are given the sum and product of two numbers and need to find those numbers. The name comes from the diamond shape used in some teaching methods.
Does the calculator work for negative numbers?
Yes, it works for any real numbers. Just enter the values with the correct sign. For example, sum -5 and product 6 results in -2 and -3.
What if the discriminant is negative?
If s² - 4p is negative, no real numbers satisfy the conditions. The calculator will inform you that there is no real solution.
Can I use this calculator to factor trinomials?
Yes. Given a trinomial like x² + bx + c, the sum is -b and the product is c. The calculator finds the numbers that sum and multiply to these values, aiding in factoring.
What is the difference between this calculator and solving a quadratic equation?
It is essentially the same. The formula used is the quadratic formula. The difference is that here you directly provide the sum and product instead of the coefficients a, b, c.