如何在java中找到符号差异

如何在java中找到符号差异,java,symbolic-math,derivative,apache-commons-math,differentiation,Java,Symbolic Math,Derivative,Apache Commons Math,Differentiation,我了解到,通过使用org.apache.commons.math3.analysis.differentication包中的DerivativeStructure,可以计算函数的偏导数 DerivativeStructure x = new DerivativeStructure(1, 3, 0, 2.5); DerivativeStructure x2 = x.pow(2); //y = 4x^2 + 2x DerivativeStructure y = new DerivativeStruc

我了解到,通过使用org.apache.commons.math3.analysis.differentication包中的DerivativeStructure,可以计算函数的偏导数

DerivativeStructure x = new DerivativeStructure(1, 3, 0, 2.5);
DerivativeStructure x2 = x.pow(2);
//y = 4x^2 + 2x
DerivativeStructure y = new DerivativeStructure(4.0, x2, 2.0, x);
System.out.println("y    = " + y.getValue());              // y    = 30.0
System.out.println("y'   = " + y.getPartialDerivative(1)); //y'   = 22.0
System.out.println("y''  = " + y.getPartialDerivative(2)); //y''  = 8.0
System.out.println("y''' = " + y.getPartialDerivative(3)); //y''' = 0.0
我想知道是否有一种方法可以得到函数的符号微分,使用DerivativeStructure类或其他库

eg:- if y = 4x^2 + 2x,   i want to find get the results as 8x+2  , 8x  not the evaluated results like 30.0 and 22.0

我不知道这个软件包,但文档引用了一篇文章,文章开头说自动微分是一种在不找到导数表达式的情况下找到表达式的导数的方法,所以这可能是进行数值微分。不,使用ApacheCommonsMath你可以找到数值解。通过symja项目,您还可以找到象征性的解决方案。