# Strategy to solving any single-variable linear equation

I'm trying to write a simple equation solving program that has explanation of what's happening each step. I want it to be almost always the same explanation, except different numbers due to different questions that are randomly generated.

I've been wondering what is the most general strategy to solving the simple 1-variable equations that are only linear (but they could be as complicated as you want). For example $$\frac{3(x+2)}{4}=\frac{2(x-4)}{3}$$ or $$2(x+3)-7=\frac{x-4}{2}$$, etc. I'm sure we all know how to do it, but what is the most efficient process for the largest amount of questions?

What I've figured out so far is this

1. Convert all fractions into equivalent ones with the denominator as the LCM
2. Multiply by the denominator so that you're not working with fractions anymore
3. Expand any brackets so that you're now working only with constants, and multiples of $$x$$.
4. Simplify so that you only have two terms on each side: 1 term that is $$x$$ with a coefficient, and the other is a constant.
5. Isolate the $$x$$'s onto one side of the equation, and isolate constants on the other side.
6. Divide by the coefficient of $$x$$ and now it's only $$x=number$$. Question solved.

At first I was thinking of, questions like $$\frac{3(x-2)}{4}=12$$ and mentioning solving for $$x$$ by doing things in reverse order of operations, but I think that above strategy is a bit better since it accounts for $$x$$'s on both sides of the equal sign.