What does this tool do?
This solver handles first-degree equations, also called linear equations, in the form ax + b = cx + d, where x can appear on both sides. It also solves first-degree inequalities with >, ≥, < or ≤. Type the four coefficients and you get the solution, the solution set S and every step of the working.
The answer is exact. If the solution is 1/3, you see 1/3 and its decimal value 0.3333, not a rounded number only. For an inequality, the result is an interval such as (−∞, 3) and a number line shows which values work. The special cases are explained too: an equation with no solution, or with every real number as a solution.
It is aimed at middle and high school students who want to check homework, and at anyone comparing two prices or plans. To solve two equations with two unknowns at the same time, use the system of equations solver.
How to use it
- Choose Equation or Inequality.
- Enter a and b (left side), then c and d if x also appears on the right. Leave c and d empty for an equation ax + b = 0.
- Read the solution, the solution set S and the step-by-step working, with the check.
Coefficients can be whole numbers, decimals with a point or a comma, negative numbers, or fractions such as 3/4. If you type a fraction, the results stay in fractions. The result updates as you type, and the Share button copies a link that reopens the same equation.
Calculation method
a ≠ c: x = (d − b) ÷ (a − c) · a = c: S = ℝ (b = d) or S = ∅ (b ≠ d)
k < 0: kx > m ⇔ x < m ÷ k
Solving means isolating x. First move every x term to the left and every number to the right. A term that changes side changes sign: +5 on the left becomes −5 on the right. Then simplify each side to get (a − c)x = d − b, and divide both sides by a − c.
When a = c, the x terms cancel out and the equation becomes a statement about numbers only. If that statement is true, such as 0 = 0, every real number is a solution. If it is false, such as 0 = 4, there is none.
An inequality is solved the same way, with one extra rule: when you divide or multiply both sides by a negative number, the inequality sign is turned around. The calculator says when it does this and why.
Worked example
Example 1: when do two phone plans cost the same?
- Plan A costs 30 DH a month plus 2 DH per GB. Plan B costs 60 DH plus 0.5 DH per GB. With x GB, the costs are equal when 2x + 30 = 0.5x + 60.
- Gather the terms: 2x − 0.5x = 60 − 30, so 1.5x = 30.
- Divide by 1.5: x = 30 ÷ 1.5 = 20.
- Check: 2 × 20 + 30 = 70 and 0.5 × 20 + 60 = 70.
At 20 GB both plans cost 70 DH. Above 20 GB, plan B is cheaper.
Another scenario: how far can a taxi take you for 50 DH?
- Take a fare of 7 DH plus 4 DH per km (example prices). With x km, you need 4x + 7 ≤ 50.
- Move the 7: 4x ≤ 50 − 7, so 4x ≤ 43.
- Divide by 4, a positive number, so the sign stays: x ≤ 43 ÷ 4 = 10.75.
S = (−∞, 10.75]. A distance is positive, so you can ride up to 10.75 km.
Understanding the results
Why the sign turns around
Take −2x + 6 > 0. Moving 6 gives −2x > −6. Dividing by −2 gives x < 3, not x > 3. Test it with x = 0: −2 × 0 + 6 = 6 is indeed greater than 0, and 0 is indeed less than 3.
No solution or every number
With 2x + 1 = 2x + 5, the x terms cancel and you get 1 = 5, which is false: S = ∅. With 2x + 2 = 2x + 2, you get 2 = 2, always true: S = ℝ. Both happen when a = c.
Fraction or decimal
3x = 1 gives x = 1/3. Its decimal 0.3333 is only an approximation, because the 3s never stop. In an exercise, write 1/3; on a bill or a measurement, use the rounded decimal.
Reading an interval
A bracket turned towards the number includes it: [2, +∞) means x ≥ 2. A round bracket excludes it: (−∞, 3) means x < 3. In French and Moroccan textbooks the same sets are written [2 ; +∞[ and ]−∞ ; 3[.
Tips and limitations
- Check your answer by putting it back into both sides: they must give the same number.
- Clear fractions first if you solve by hand: multiply every term by the common denominator.
- For a word problem, write what x stands for before writing the equation.
- Use the fraction calculator if the coefficients themselves need simplifying.
Mistakes to avoid
- Moving a term to the other side without changing its sign.
- Dividing only one side of the equation by the coefficient.
- Forgetting to turn the inequality sign around after dividing by a negative number.
- Writing “no solution” when the equation reduces to 0 = 0: every number works.
Frequently asked questions
How do I solve a linear equation?
Move the x terms to one side and the numbers to the other, changing the sign of each term that changes side. Simplify, then divide by the coefficient of x. For example 3x + 5 = x − 1 gives 2x = −6, so x = −3.
Why does the inequality sign flip?
Multiplying or dividing by a negative number reverses the order: 2 < 3 but −2 > −3. So in −2x > −6, dividing by −2 gives x < 3, not x > 3.
What happens when a = c?
The x disappears. If the numbers left are equal (0 = 0), every number is a solution: S = ℝ. Otherwise (for example 0 = 4), there is no solution: S = ∅.
Can x be on both sides of the equation?
Yes. Enter the coefficient of x on the right as c and the number on the right as d. For ax + b = 0, leave c and d empty.
What is a first-degree equation?
An equation in which x appears only to the power 1: no x², no x in a denominator. Its graph is a straight line, so it has at most one solution unless a = c.