This tutorial will show you how to create a formula to solve a basic linear equation in the form of Ax+B=C.
Quick Glance at the Equation
Below is a quick glance of the equation Ax+B=C.
So, the main parts of the equation Ax+B=C are:
- The x term, Ax.
- The coefficient, A.
- The operator, usually plus or minus.
- The constant, B.
Steps to Create the Formula
Before we get deep into the steps, here is what we plan to do:
- Create a sample equation to solve.
- Solve both equations at the same time.
Here is what we plan to do:
- Subtract the constant from both sides.
- Divide by the coefficient on both sides.
That is all to it.
Follow the steps below to create a formula to solve a basic linear equation.
Step 1: Isolate the x Terms
Remember, the x terms are 4x and Ax.
In order to isolate the x terms, we must subtract the constant value from both sides of the equation. Therefore, subtract -1 from both sides in the first equation. And, subtract -B from both sides of the second equation.
This will eliminate the constant from the left side of both equations.
So, now we have 4x=20 and Ax=C-B.
Step 2: Solve for x
To solve for x, divide by the coefficient on both sides of the equation. So, in the first case, you divide by 4. And, in the second case, you divide by A.
Now, you have solutions for both equations. In the first equation, x equals 5. And, in the second equation, you just made a formula.
Notice how x is by itself on one side of the formula. When you create a formula, you want to make sure your unknown (x) is on one side, and the inputs on the other side.
Test Your Formula
Let’s use the values from the first equation to test our formula. So, insert the numbers from the first equation into the variables in the second equation.
As you see, the formula works. Now, you can plug in your numbers directly into the formula and solve. Keep in mind, you must perform the operations in the numerator first, before dividing by the denominator.
Although we did not have to, we placed parentheses around the numerator.
That simply tells us, we have to perform the operations inside the parentheses before dividing by A.
Cannot Divide by Zero
Since we really cannot divide by zero, the variable A cannot equal zero.
Turn the Formula into a Format a Computer Can Use
Finally, we must change the formula a little for it to work in a computer program. Basically, the division sign in computing is the slash (“/”) symbol. Take a look at the final formula below.
At last, there you have it. On the whole, you now have a formula you can use in almost any programming language. And, remember A still cannot equal zero.
Create a formula to solve for x for the equation below.