Factorising with MathNet.Symbolics in c#

249 views Asked by At

I am trying to factorise: 5x+10 -> 5(x+2)

Everything I have tried either fails miserably or just returns "10+5*x", or worse.

    public void Factorising()
    {
        var expr = "5*x+10";
        var parsing = Infix.ParseOrThrow(expr);
        var ratExpand = Rational.Expand(parsing);
        var format = Infix.Format(ratExpand);
    }
Returns: 10+5*x

I have also tried using Algebraic.Factors, Rational.Simplify and I am sure others.

Also, is there any decent documentation for MathNet? I am trying to figure out how to use the library from forum posts, their github tests and there's little else for Symbolics...it is a nightmare.

0

There are 0 answers