Search code examples
maximaexponentiation

How to force 0^0 be 1 in Maxima?


It is suitable in many series and polynomials to treat 0^0 as 1.

Unfortunately, Maxima think it is expt.

How to force?


Solution

  • Try this. Use tellsimp to define a different rule for the simplification of 0^0.

    (%i1) display2d : false $
    (%i2) simp : false $
    (%i3) tellsimp (0^0, 1);
    (%o3) [\^rule1,simpexpt]
    (%i4) simp : true $
    (%i5) 0^0;
    (%o5) 1
    (%i6) sum (k^k, k, 0, 5);
    (%o6) 3414
    

    Note that you must disable simplification (via simp:false$) before defining the rule, otherwise the default simplification (which triggers an error) is applied.