Algebra Online Calculator Step for Step

Linear Equation Solver: ax + b = c

Use this calculator to solve for 'x' in a linear equation of the form ax + b = c. Enter the coefficients and constants, and the calculator will provide the step-by-step solution.

Understanding Linear Equations

A linear equation is an algebraic equation in which each term has an exponent of one and the graphing of the equation results in a straight line. The most common form for a single-variable linear equation is ax + b = c, where:

  • x is the variable you are solving for.
  • a is the coefficient of x (it multiplies x).
  • b is a constant term.
  • c is another constant term on the other side of the equation.

The goal when solving a linear equation is to isolate the variable x on one side of the equation.

How to Solve ax + b = c (Step-by-Step)

To solve an equation of the form ax + b = c, you typically follow these steps:

  1. Isolate the term with 'x': Subtract the constant b from both sides of the equation. This moves the constant term away from the variable term.
    ax + b - b = c - b
    ax = c - b
  2. Isolate 'x': Divide both sides of the equation by the coefficient a. This will leave x by itself.
    ax / a = (c - b) / a
    x = (c - b) / a

It's important to remember that whatever operation you perform on one side of the equation, you must perform the same operation on the other side to maintain equality.

Examples of Linear Equations

Let's look at a few examples:

Example 1: Simple Positive Values

Solve: 2x + 5 = 15

  1. Subtract 5 from both sides: 2x = 15 - 52x = 10
  2. Divide by 2: x = 10 / 2x = 5

Example 2: Including Negative Values

Solve: -3x + 7 = 1

  1. Subtract 7 from both sides: -3x = 1 - 7-3x = -6
  2. Divide by -3: x = -6 / -3x = 2

Example 3: Fractional Result

Solve: 4x - 3 = 8

  1. Add 3 to both sides: 4x = 8 + 34x = 11
  2. Divide by 4: x = 11 / 4x = 2.75

Use the calculator above to practice solving these and other linear equations!

/* Basic styling for the calculator and article */ .calculator-container { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f9f9f9; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); max-width: 700px; margin: 20px auto; border: 1px solid #ddd; } .calculator-container h2 { color: #333; text-align: center; margin-bottom: 20px; } .calculator-container p { line-height: 1.6; color: #555; } .calculator-inputs label { display: block; margin-bottom: 8px; font-weight: bold; color: #444; } .calculator-inputs input[type="number"] { width: calc(100% – 22px); padding: 10px; margin-bottom: 15px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } .calculator-inputs input[type="number"]:focus { border-color: #007bff; outline: none; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); } .calculator-container button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 4px; font-size: 18px; cursor: pointer; transition: background-color 0.3s ease; margin-top: 10px; } .calculator-container button:hover { background-color: #0056b3; } .calculator-result { background-color: #e9f7ef; border: 1px solid #d4edda; border-radius: 4px; padding: 15px; margin-top: 25px; color: #155724; min-height: 50px; } .calculator-result h3 { color: #155724; margin-top: 0; margin-bottom: 10px; } .calculator-result p { margin-bottom: 5px; color: #155724; } .calculator-result ol { margin-left: 20px; padding-left: 0; color: #155724; } .calculator-result ol li { margin-bottom: 5px; } .calculator-article { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; } .calculator-article h3 { color: #333; margin-top: 20px; margin-bottom: 15px; } .calculator-article h4 { color: #444; margin-top: 15px; margin-bottom: 10px; } .calculator-article ul, .calculator-article ol { margin-left: 20px; margin-bottom: 15px; color: #555; } .calculator-article ul li, .calculator-article ol li { margin-bottom: 8px; } .calculator-article code { background-color: #e0e0e0; padding: 2px 4px; border-radius: 3px; font-family: 'Courier New', Courier, monospace; color: #c7254e; } function calculateAlgebra() { var a = parseFloat(document.getElementById("coefficientA").value); var b = parseFloat(document.getElementById("constantB").value); var c = parseFloat(document.getElementById("constantC").value); var resultDiv = document.getElementById("algebraResult"); var steps = []; var solution = ""; // Input validation if (isNaN(a) || isNaN(b) || isNaN(c)) { resultDiv.innerHTML = "Please enter valid numbers for all fields."; return; } steps.push("

Step-by-Step Solution:

"); steps.push("Given equation: " + a + "x + " + b + " = " + c + ""); // Step 1: Subtract 'b' from both sides var c_minus_b = c – b; steps.push("Step 1: Subtract " + b + " from both sides to isolate the 'x' term."); steps.push("" + a + "x + " + b + " - " + b + " = " + c + " - " + b + ""); steps.push("Simplifies to: " + a + "x = " + c_minus_b + ""); // Step 2: Divide by 'a' if (a === 0) { if (c_minus_b === 0) { solution = "Result: Infinite Solutions"; steps.push("Step 2: Since the coefficient 'a' is 0 and the right side is also 0 (0x = 0), there are infinite solutions for x."); } else { solution = "Result: No Solution"; steps.push("Step 2: Since the coefficient 'a' is 0 but the right side is not 0 (0x = " + c_minus_b + "), there is no solution for x."); } } else { var x = c_minus_b / a; steps.push("Step 2: Divide both sides by " + a + " to solve for 'x'."); steps.push("" + a + "x / " + a + " = " + c_minus_b + " / " + a + ""); steps.push("Simplifies to: x = " + x.toFixed(4) + ""); // Format to 4 decimal places solution = "Final Solution: x = " + x.toFixed(4) + ""; } resultDiv.innerHTML = steps.join("") + solution; }

Leave a Reply

Your email address will not be published. Required fields are marked *