Enter the coefficients of the linear equation ax + b = cx + d. The equation below is linked to the input fields, so you can also edit the coefficients directly in it.
Table of Contents
-
What you can do on this page
-
What is this calculation used for?
-
How to Use
-
Formulas and graphs
-
Symbols and terms
-
Good to know before you start
-
How to calculate it in Excel
-
How to calculate it in Google Sheets
-
How to calculate it in Python
-
How to write it in LaTeX and other math languages (copy and paste)
-
How to have ChatGPT do the calculation
-
DataChef Features
-
Related Features
-
NumberChef Calculators List
What you can do on this page
- Solve a linear equation of the form \(ax + b = cx + d\) just by entering the coefficients, with step-by-step work
- The solution is shown both as a fraction in lowest terms such as \(\dfrac{2}{3}\) (the exact value) and as a decimal. A check is shown too: the solution is substituted back to confirm that both sides are equal
- When both sides have the same coefficient of \(x\), it tells you whether there is "no solution" or "all real numbers" (infinitely many solutions), and why
- The calculator shows the equation as you would write it by hand, and you can edit the coefficients right in it
- Coefficients can be decimals, negative numbers or fractions such as 3/4
- The result also graphs the two lines \(y = \) (left side) and \(y = \) (right side), so you can see that the \(x\)-coordinate of the intersection is the solution
What is this calculation used for?
"Plan A has a higher base fee but a lower unit price, and Plan B has a lower base fee but a higher unit price." The point where one becomes cheaper than the other is a linear equation of the form \(ax + b = cx + d\). For example, compare a plan at $30 a month plus $3 per GB with a plan at $15 a month plus $6 per GB. Solving \(3x + 30 = 6x + 15\) gives \(x = 5\) (GB). If you use more than 5 GB a month, the first plan is cheaper.
Electricity plans, gym memberships, and buying outright versus subscribing all work the same way: any comparison of "fixed cost + unit price × amount" is this calculation.
When someone chases a person who left earlier, "how many minutes until they catch up" is a linear equation: find the time when both have gone the same distance. For example, a boy leaves home walking at 250 feet per minute, and 9 minutes later his sister follows on a bike at 1,000 feet per minute. \(t\) minutes after the sister leaves, the boy has gone \(250t + 2250\) feet and the sister \(1000t\) feet. Solving \(250t + 2250 = 1000t\) gives \(t = 3\), so she catches up in 3 minutes.
It is a classic algebra word problem, and it is also the same idea as estimating when two travelers or two deliveries will meet.
Shops and factories use a linear equation to find "how many units we must sell to make a profit" (the break-even point). For example, a product sells for $8, its materials cost $3 per unit, and fixed costs such as rent are $6,000 a month. The number of units where revenue equals cost comes from solving \(8x = 3x + 6000\), which gives \(x = 1200\) units. Selling 1,200 units a month is the line between profit and loss.
When planning a new business or product, this is one of the first numbers people check.
A Fahrenheit temperature can be written from the Celsius temperature \(C\) as "Fahrenheit = \(1.8C + 32\)". Finding "what is 86 °F in Celsius?" is the same as solving the linear equation \(1.8C + 32 = 86\). Move the 32 to get \(1.8C = 54\), then divide both sides by 1.8 to get \(C = 30\) degrees.
Whenever you know the conversion formula but want to go the other way (unit conversions, working back from a bill, and so on), you are solving a linear equation.
A linear equation also tells you when two people's savings will be the same, if they start with different amounts and save different amounts each month. For example, a younger brother has $50 now and saves $15 a month, and his older brother has $200 now and saves $5 a month. Solving \(15m + 50 = 5m + 200\) gives \(m = 15\), so they will be equal in 15 months.
"When will two amounts that grow at different rates be equal?" Saving plans and goal planning are everyday uses of this equation.
Formulas and graphs
Symbols and terms
Symbols
| \(x\) | ex | The letter for the number you want to find (the unknown). Think of it as "a box for a number we do not know yet". Solving an equation means finding the number that goes in \(x\). Using letters near the end of the alphabet, such as \(x,\ y,\ z\), for unknowns is said to have started with the mathematician Descartes. |
| \(a,\ c\) | a, c | The coefficients of \(x\) (the numbers in front of \(x\)). On this page, \(a\) is the coefficient of \(x\) on the left side and \(c\) is the one on the right side. By custom, letters near the start of the alphabet, \(a,\ b,\ c\), stand for fixed numbers. |
| \(b,\ d\) | b, d | The constant terms (the number-only terms). On this page, \(b\) is the constant term on the left side and \(d\) is the one on the right side. |
| \(=\) | equals | The equal sign. It shows that the left side and the right side are equal. The 16th-century mathematician Robert Recorde is said to have introduced it, because "no two things can be more equal" than two parallel lines. When you rewrite an equation, the most important thing is to keep this "equal" relation. |
| \(0 \times x\) | zero times x | The form you get when you simplify an equation whose two sides have the same coefficient of \(x\). Its value is 0 whatever number \(x\) is, so if the right side is 0 it is "true for every \(x\)", and otherwise it is "true for no \(x\)". |
Terms
| equation | Two expressions joined by the equal sign "=". It states that the left side and the right side are equal. |
| equation with an unknown | An equation that is true only when a certain number is put in for the letter (the unknown). For example, \(x + 3 = 5\) is true only when \(x = 2\). |
| linear equation | An equation in which the unknown appears only to the first power (\(x\)), with no terms such as \(x^2\). It can always be written in the form \(ax + b = cx + d\). Taught in Grades 7–8. |
| solution | A value of the unknown that makes the equation true. To "solve" an equation means to find all of its solutions. |
| left side | The expression to the left of the equal sign. Together with the right side, they are called "both sides". |
| right side | The expression to the right of the equal sign. Together with the left side, they are called "both sides". |
| transposing (moving a term) | Moving a term of an equation to the other side and changing its sign. It is a one-step way of writing the property "add or subtract the same number on both sides". |
| properties of equality | The rules that an equation stays true when you add, subtract or multiply both sides by the same number, or divide both sides by the same nonzero number. Every step in solving an equation is based on these properties. |
| term | Each piece of an expression separated by plus or minus signs. \(3x + 2\) has two terms, \(3x\) and \(2\). |
| coefficient | The number in front of a letter. In \(3x\), the coefficient is 3. When no number is written, as in \(x\), the coefficient is 1. |
| constant term | A number-only term with no letter, such as the 2 in \(3x + 2\). It is called constant because it does not change whatever value \(x\) has. |
| unknown | A number whose value we do not know yet and want to find. In equations it is usually written as \(x\). It is also called the variable. |
| like terms | Terms with the same letter part. \(3x\) and \(-x\) are like terms, and they can be combined into one term, \(2x\), by working out the coefficients. |
| identity | An equation that is true whatever number is put in for the letter. For example, \(2x + 1 = 2x + 1\) is an identity, and solving it gives "all real numbers". |
| check | Substituting the solution back into the original equation to make sure both sides really are equal. It catches sign mistakes made when moving terms or dividing. |
Good to know before you start
Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back to review these topics is the fastest way forward.
| Positive and negative numbers (Grade 7) |
|
| Algebraic expressions (Grades 6–7) |
|
| What the equal sign means (elementary school to Grade 7) |
|
| Working with fractions (Grades 5–7) |
|
How to calculate it in Excel
| Coefficient of x on the left, a | 3 |
| Constant on the left, b | 2 |
| Coefficient of x on the right, c | 1 |
| Constant on the right, d | 10 |
| Difference of x coefficients a−c | =B1-B3 |
| Difference of constants d−b | =B4-B2 |
| Solution x = (d−b) ÷ (a−c) | =B6/B5 |
| Number to move b | 3 |
| Number on the right d | 5 |
| Solution x = d − b | =B2-B1 |
| Coefficient of x on the left, a | 2 |
| Constant on the left, b | 3 |
| Coefficient of x on the right, c | 2 |
| Constant on the right, d | 5 |
| Difference of x coefficients a−c | =B1-B3 |
| Difference of constants d−b | =B4-B2 |
| Result | =IF(B5<>0,"One solution",IF(B6=0,"All real numbers (infinitely many solutions)","No solution")) |
The first table solves 3x + 2 = x + 10, and the solution is (10 − 2) ÷ (3 − 1) = 4. Replace the coefficients with the numbers from your own equation.
The second table checks transposing for x + 3 = 5, and the solution is 5 − 3 = 2.
The third table is for 2x + 3 = 2x + 5. The difference of the x coefficients is 0 and the difference of the constants is 2, so the result is "No solution".
How to calculate it in Google Sheets
| Coefficient of x on the left, a | 3 |
| Constant on the left, b | 2 |
| Coefficient of x on the right, c | 1 |
| Constant on the right, d | 10 |
| Difference of x coefficients a−c | =B1-B3 |
| Difference of constants d−b | =B4-B2 |
| Solution x = (d−b) ÷ (a−c) | =B6/B5 |
| Number to move b | 3 |
| Number on the right d | 5 |
| Solution x = d − b | =B2-B1 |
| Coefficient of x on the left, a | 2 |
| Constant on the left, b | 3 |
| Coefficient of x on the right, c | 2 |
| Constant on the right, d | 5 |
| Difference of x coefficients a−c | =B1-B3 |
| Difference of constants d−b | =B4-B2 |
| Result | =IF(B5<>0,"One solution",IF(B6=0,"All real numbers (infinitely many solutions)","No solution")) |
How to calculate it in Python
from fractions import Fraction
# Coefficients of ax + b = cx + d (a fraction such as 3/4 can be written Fraction(3, 4))
left_x_coef = Fraction(3) # coefficient of x on the left, a
left_const = Fraction(2) # constant on the left, b
right_x_coef = Fraction(1) # coefficient of x on the right, c
right_const = Fraction(10) # constant on the right, d
# After moving terms and simplifying: (a−c)x = d−b
coef_diff = left_x_coef - right_x_coef
const_diff = right_const - left_const
if coef_diff != 0:
solution = const_diff / coef_diff
print(f"Solution (fraction): x = {solution}")
print(f"Solution (decimal): x = {float(solution)}")
elif const_diff == 0:
print("All real numbers (infinitely many solutions)")
else:
print("No solution")
How to write it in LaTeX and other math languages (copy and paste)
x = (d − b)/(a − c)
x = \frac{d - b}{a - c}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow><mi>d</mi><mo>−</mo><mi>b</mi></mrow>
<mrow><mi>a</mi><mo>−</mo><mi>c</mi></mrow>
</mfrac>
</mrow>
</math>
x = (d - b)/(a - c)
Solve[a x + b == c x + d, x]
solve(a*x + b = c*x + d, x);
solve(a*x + b == c*x + d, x)
x = (d − b)/(a − c)
x + b = d ⇔ x = d − b
x + b = d \iff x = d - b
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mi>x</mi><mo>+</mo><mi>b</mi><mo>=</mo><mi>d</mi>
<mo>⇔</mo>
<mi>x</mi><mo>=</mo><mi>d</mi><mo>−</mo><mi>b</mi>
</mrow>
</math>
x + b = d <=> x = d - b
Solve[x + b == d, x]
solve(x + b = d, x);
solve(x + b == d, x)
x + b = d ⇔ x = d − b
(a − c)x = d − b
(a - c)x = d - b
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mrow>
<mo>(</mo><mi>a</mi><mo>−</mo><mi>c</mi><mo>)</mo>
<mi>x</mi>
<mo>=</mo>
<mi>d</mi><mo>−</mo><mi>b</mi>
</mrow>
</math>
(a - c)x = d - b
Reduce[a x + b == c x + d, x]
solve(a*x + b = c*x + d, x);
solve(a*x + b == c*x + d, x)
(a − c)x = d − b
How to have ChatGPT do the calculation
You are a calculation assistant for middle school math (algebra). Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing). Solve the linear equation 3x + 2 = x + 10. Show each of the following: 1. The step of moving terms (the equation with the x terms moved to the left side and the number terms moved to the right side) 2. The simplified equation (in the form (a−c)x = d−b) 3. The solution x (if it does not divide evenly, give both a fraction in lowest terms and a decimal) 4. A check (substitute the solution and confirm that both sides are equal) In Python, calculate exactly with the fractions module from the standard library, and show the formulas you used and the numbers from the execution result.
How to Use
-
1Enter your numbersType the numbers you want to calculate with into the input fields
-
2CalculatePress the "Calculate" button
-
3Check the resultThe result appears on the spot. The same page also explains the idea behind the calculation and the formula
DataChef Features
No technical knowledge required.
Intuitive and user-friendly operation.
Can be used without registering personal information.
Automatic file deletion by clicking "download".
and rapid file conversion.
No attribution required.
No need to contact us for commercial use permission.
