+ 4

How to create a differentiation function ?

Is there any way to create a function that will return the derivative of any function passed to it? What is the general way to do it??

29th Mar 2017, 9:14 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
5 ответов
+ 9
I don't think it's possible. But with a little effort, you can do it for simpler functions.
29th Mar 2017, 9:22 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 6
Consider a(x)^b for example. Scan the input as a string and extract a, b values and apply the formula. This is not even 1% of differentiation though. As far as my knowledge goes, we can't do differentiation.
29th Mar 2017, 9:28 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 4
But how, sir? I mean, is if-else the only way? Maybe there's an algorithm or some formula?
29th Mar 2017, 9:24 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 4
But there is NumPy in Python which has a diff() function for derivative... It can give an answer for any function, polynomial entered... Now I wonder, how did they make that?
29th Mar 2017, 9:30 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 3
@JPM7 Thank You!!!
29th Mar 2017, 9:38 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar