public Funcion derivar(String var) { Funcion LadoIzq = new Mult(Num.derivar(var), Den); Funcion LadoDer = new Mult(Num, Den.derivar(var)); Funcion Abajo = new Potencia(Num, new Numero(2)); Funcion Arriba = new Suma(LadoIzq, new Mult(new Numero(-1.0), LadoDer)); Funcion derivada = new Mult(Arriba, new Potencia(Abajo, new Numero(-1))); return derivada; }
public double resolver() { return (operacion1.resolver() + operacion2.resolver()); }
@Override public String toString() { return "(" + Num.toString() + ")" + "/" + "(" + Den.toString() + ")"; }
public double evaluar(Hashtable<String, Double> Table) { double evalArg1 = Num.evaluar(Table); double evalArg2 = Den.evaluar(Table); return evalArg1 / evalArg2; }