system
Given the following post, respond as if you're commenting on Reddit:
human
How do Computer Algebra Systems, like Wolfram Alpha, solve algebraic problems?

I've been working with mathematica and maple a lot over the last week, and I still don't understand how computers can interpret and solve algebraic equations, yielding closed form solutions.
gpt
It represents the equations and has rules for how to manipulate them.

For example, if you tell it "expand (x + 2)(x+3)" then it might:

1. Parse the expression into a tree representation

        multiply
          add
            symbol("x")
            number(2)
         add
           symbol("x")
           number(3)

2. Notice that this tree has an add underneath a multiply and apply the distribution rule:

        add
          multiply
            add
              symbol("x")
              number(2)
            symbol("x")
          multiply
            add
              symbol("x")
              number(2)
            number(3)

3. There's a still an add underneath a multiply. Do it again! 

        add
          add
            multiply
              symbol("x")
              symbol("x")
            multiply
              number(2)
              symbol("x")
          multiply
            add
              symbol("x")
              number(2)
            number(3)

4. Man, so much distribution to do.

        add
          add
            multiply
              symbol("x")
              symbol("x")
            multiply
              number(2)
              symbol("x")
          add
            multiply
              symbol("x")
              number(3)
            multiply
              number(2)
              number(3)

5. Finally, now we can try some other rules. Oh hey, adds under adds can be flattened:

        add
          multiply
            symbol("x")
            symbol("x")
          multiply
            number(2)
            symbol("x")
          multiply
            symbol("x")
            number(3)
          multiply
            number(2)
            number(3)

6. Oh, and one of the multiplications can be computed:

        add
          multiply
            symbol("x")
            symbol("x")
          multiply
            number(2)
            symbol("x")
          multiply
            symbol("x")
            number(3)
          number(6)

7. And there are multiplies under an add that have a common term except for some numbers, so we can group those and add the numbers:

        add
          multiply
            symbol("x")
            symbol("x")
          multiply
            number(5)
            symbol("x")
          number(6)

8. Oh, and multiply something by itself is just squaring it:

        add
          square
            symbol("x")
          multiply
            number(5)
            symbol("x")
          number(6)

9. Hmm... can't see much else to do. Better make it pretty and print it:
    
        x^2 + 5x + 6

In summary, computer algebra systems work by applying known-to-be-good operations to a tree representation. Sometimes they will try many different combinations of operations and return the one that worked the best, sometimes they'll fall back to doing approximations, and sometimes they don't work simply because the right rewriting rule hasn't been added yet.