Im making a calculator app for Android, and a user requested for a derivatives calculator. Is there any preloaded function or a custom method available? Thanks.
If Internet access is going to be available, you could delegate differentiation to Wolfram Alpha. Although free of charge API usage comes with limitations in the number of API calls.
I'll attempt to answer, following on from @Ernest in the comments.
It depends largely on what derivatives you want to include. If you want to be able to differentiate only polynomials then it would be pretty easy to just write your own differentiation methods because they're really straightforward.
The part that requires thought is in representing the polynomials. This could simply be done by storing each term as a pair consisting of the coefficient and the exponent parts. With some simple multiplication and subtraction, you can differentiate.
You could take it a step further using recursion and implement the Chain Rule for differentiation to allow differentiation of nested polynomials.
For most people, this is probably good enough, or better than they need.
My suggestion: limit your scope and have fun doing it yourself
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With