Derivatives in Java?

Im making a calculator app for Android, and the user is asking for a calculator for derivatives. Is there a predefined function or custom method? Thanks.

+6
source share
2 answers

If Internet access is available, you can delegate the differentiation of Wolfram Alpha . Although the free use of the API is associated with limitations in the number of API calls.

+2
source

I will try to answer by following from @Ernest in the comments.

This mainly depends on which derivatives you want to enable. If you want to distinguish only polynomials, then it would be quite simple to write your own differentiation methods, because they are really understandable.

The part requiring thought is the presentation of polynomials. This can simply be done by saving each member as a pair consisting of a coefficient and parts of the exponent. With the help of simple multiplication and subtraction, you can distinguish.

You can do this even further using recursion and implement a chain rule for differentiation to allow differentiation of nested polynomials.

For most people, this is probably good enough or better than necessary.

My suggestion: limit your reach and enjoy it yourself.

+1
source

Source: https://habr.com/ru/post/921041/


All Articles