Calculus.js
function(x) { 
                    var g = x.group; 
                    if(g === FN) {
                        var fname = x.fname;
                        if(core.Utils.in_trig(fname) || core.Utils.in_htrig(fname))
                            parts[3].push(x);
                        else if(core.Utils.in_inverse_trig(fname))
                            parts[1].push(x);
                        else if(fname === LOG)
                            parts[0].push(x);
                        else { 
                            __.integration.stop();
                        }
                    }
                    else if(g === S || x.isComposite() && x.isLinear() || g === CB && x.isLinear()) {
                        parts[2].push(x);
                    }
                    else if(g === EX || x.isComposite() && !x.isLinear())
                        parts[4].push(x);
                    else
                        __.integration.stop();
                }
function(x) { 
                    var g = x.group; 
                    if(g === FN) {
                        var fname = x.fname;
                        if(core.Utils.in_trig(fname) || core.Utils.in_htrig(fname))
                            parts[3].push(x);
                        else if(core.Utils.in_inverse_trig(fname))
                            parts[1].push(x);
                        else if(fname === LOG)
                            parts[0].push(x);
                        else { 
                            __.integration.stop();
                        }
                    }
                    else if(g === S || x.isComposite() && x.isLinear() || g === CB && x.isLinear()) {
                        parts[2].push(x);
                    }
                    else if(g === EX || x.isComposite() && !x.isLinear())
                        parts[4].push(x);
                    else
                        __.integration.stop();
                }
function ( x ) { var g = x . group ; if ( g === FN ) { var fname = x . fname ; if ( core . Utils . in_trig ( fname ) || core . Utils . in_htrig ( fname ) ) parts [ 3 ] . push ( x ) ; else if ( core . Utils . in_inverse_trig ( fname ) ) parts [ 1 ] . push ( x ) ; else if ( fname === LOG ) parts [ 0 ] . push ( x ) ; else { __ . integration . stop ( ) ; } } else if ( g === S || x . isComposite ( ) && x . isLinear ( ) || g === CB && x . isLinear ( ) ) { parts [ 2 ] . push ( x ) ; } else if ( g === EX || x . isComposite ( ) && ! x . isLinear ( ) ) parts [ 4 ] . push ( x ) ; else __ . integration . stop ( ) ; }
first we sort them
first we sort them