lib/integral.js
function(expr, context, subIntegral) {
      if(expr.type === "OperatorNode" && (expr.op === '+' || expr.op === '-')) {
        var childInts = expr.args.map(function(expr) {
          return subIntegral(expr, context, "sum rule");
        });

        if(childInts.every(function(n) { return n; })) {
          return new OperatorNode(expr.op, expr.fn, childInts);
        }
      }
    }
function(expr, context, subIntegral) {
      if(expr.type === "OperatorNode" && (expr.op === '+' || expr.op === '-')) {
        var childInts = expr.args.map(function(expr) {
          return subIntegral(expr, context, "sum rule");
        });

        if(childInts.every(function(n) { return n; })) {
          return new OperatorNode(expr.op, expr.fn, childInts);
        }
      }
    }
function ( expr , context , subIntegral ) { if ( expr . type === "OperatorNode" && ( expr . op === '+' || expr . op === '-' ) ) { var childInts = expr . args . map ( function ( expr ) { return subIntegral ( expr , context , "sum rule" ) ; } ) ; if ( childInts . every ( function ( n ) { return n ; } ) ) { return new OperatorNode ( expr . op , expr . fn , childInts ) ; } } }
integral(+/- f(x), x) = +/- integral(f(x), x) and integral(f(x) +/- g(x), x) = integral(f(x), x) +/- integral(g(x), x)
integral ( + / - f ( x ) x ) = + / - integral ( f ( x ) x ) and integral ( f ( x ) + / - g ( x ) x ) = integral ( f ( x ) x ) + / - integral ( g ( x ) x )