org.apache.commons.math3.analysis.differentiation パッケージの 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