← All algebra calculators

ALGEBRA / LINEAR

Linear Equation Calculator

Solve linear equations with x on both sides. Get exact fractions, worked steps and a graph.

Set up your equation

ax + b = cx + d

Use numbers or fractions (for example −2, 0.5 or 3/4). Up to 6 decimal places; coefficient magnitude at most 1,000,000.

How to use this solver

Move every x term to the left and each constant to the right. The equation becomes (a − c)x = d − b. Divide by a − c when it is nonzero. If both sides reduce to zero, every real number works; if only the x coefficient becomes zero, the equation has no solution.

Questions about linear equations

Can x appear on both sides?

Yes. Enter the x coefficient and constant from each side. For 3x + 5 = 2x − 7, enter 3, 5, 2 and −7.

Can I enter fractions?

Yes. Coefficients accept fractions such as 2/3 and decimals with up to six decimal places. The solution and substitution check use exact fraction arithmetic.

Can I type a whole equation?

Use the labelled coefficient fields. First collect like terms and expand brackets yourself. This solver does not parse unrestricted equation text.

How can I compare two rental or subscription plans?

Set the two total costs equal. Suppose a bike rental costs $12 plus $4 per hour with Plan A, or $24 plus $2 per hour with Plan B. Write 4x + 12 = 2x + 24, where x is the number of hours. Enter 4, 12, 2 and 24 in the four fields. The answer is x = 6: both plans cost $36 for six hours. Below six hours, Plan A is cheaper; above six hours, Plan B is cheaper, assuming those rates stay the same.

How do I work out how long it will take to reach a savings goal?

For a simple goal with no interest, add your starting savings to your regular contributions. If you already have $250 and save $75 each month toward $1,000, use 75x + 250 = 1,000. Enter 75, 250, 0 and 1000. The answer is 10 monthly contributions. This example assumes no withdrawals, fees or interest.

Can I calculate how many items I can buy within a budget?

Yes. If each item costs $18, delivery is $7 and your budget is $100, solve 18x + 7 = 100 by entering 18, 7, 0 and 100. The result is x = 31/6, or about 5.17. Since you can only buy whole items, round down to 5. Five items cost $97 including delivery; six would cost $115. The equation finds the budget boundary, so check which whole-number quantity stays within it.

How can I find a simple break-even sales quantity?

Set revenue equal to total cost. Suppose you sell an item for $25, each item costs $10 to make, and your fixed setup cost is $300. Use 25x = 10x + 300 and enter 25, 0, 10 and 300. You break even at 20 items, with revenue and costs both equal to $500. If the answer is fractional, round up to find the first whole-item quantity that covers costs, provided the selling price is greater than the cost per item. This model assumes every item is sold and unit costs remain constant.

Can I find the original price before a discount?

For a single percentage discount, multiply the original price by the fraction you still pay. If an item costs $68 after a 15% discount, you pay 85% of its original price: 0.85x = 68. Enter 0.85, 0, 0 and 68. The original price is $80. This example assumes the $68 contains no extra tax, delivery charge or other adjustment.

How can I work out the numbers of two ticket types sold?

If you know the total number of tickets, you can reduce the problem to one unknown. Suppose 20 tickets brought in $160, with adult tickets at $10 and child tickets at $5. Let x be adult tickets, so child tickets equal 20 − x. Start with 10x + 5(20 − x) = 160, then expand and simplify to 5x + 100 = 160. Enter 5, 100, 0 and 160. The answer is 12 adult tickets and 8 child tickets.

What does a negative or fractional answer mean in a real-life problem?

The equation can be correct even when its solution is not practical. A negative number of rental hours could mean the two plans never cost the same for any usable rental duration. A fractional number of items may describe a mathematical boundary rather than a quantity you can purchase. Check the units, whether negative values make sense, and whether x must be a whole number before using the result.

When is a linear equation the wrong model?

A linear equation assumes a constant change per unit, such as the same price for every extra hour or item. Tiered prices, overtime rates, compound growth and quantity discounts may need separate equations for different ranges or another calculator. Use the same units on both sides: for example, convert minutes to hours before combining them with an hourly rate.