public void substract(Polynomials p){
        for(int i = 0; i < p.polynomial.size() - 1; i++){
            Term t = p.polynomial.get(i);
            t.factor = -t.factor;
            p.polynomial.set(i, t);
        }
    }