calculus

Recursively find the second derivative

佐手、 提交于 2021-02-19 23:37:10
问题 I'm attempting to write a program in C which finds the numeric value of the second derivative of f(x) where x is given. When I use my function to find the first derivative, everything seems to be working okay, but the recursive second derivative part always gives me 0.0. Here's my function: double derivative(double (*f)(double), double x0, int order) { if(order == 1){ const double delta = 1.0e-6; double x1 = x0-delta; double x2 = x0+delta; double y1 = f(x1); double y2 = f(x2); return (y2 - y1

Step by step differentiation with sympy

≯℡__Kan透↙ 提交于 2021-02-08 10:13:53
问题 I'm trying to make a python proram to find derivatives and integrals as well as showing how. I have so far found that there is an integral_steps function which returns the steps used, but I have not found an equivalent for differentiation. Does anyone know if there is an equivalent? If there isn't, do you have any ideas on how to find the steps needed to find a derivative? 回答1: Method 1 (manual) Looking at the code, the Derivative class is where the top-level logic lives. That's only the top

Step by step differentiation with sympy

我只是一个虾纸丫 提交于 2021-02-08 10:10:20
问题 I'm trying to make a python proram to find derivatives and integrals as well as showing how. I have so far found that there is an integral_steps function which returns the steps used, but I have not found an equivalent for differentiation. Does anyone know if there is an equivalent? If there isn't, do you have any ideas on how to find the steps needed to find a derivative? 回答1: Method 1 (manual) Looking at the code, the Derivative class is where the top-level logic lives. That's only the top