I need to code a symbolic differentiation program :s

Ok... I'd like you guys to give me a hint...

I need to resolve big functions, only explicit ones [ex: f(x)=(x^2+x)/(1-x)^2], I'm a CPP beginner...

Some guys gave me an advice about using LL parsers and expression trees... but I was checking that out and I'm really not in that CPP level yet...

Could you guys gently help me?

I'm not asking for a code, I'm asking for ideas...
OP wrote:
Some guys gave me an advice about using LL parsers and expression trees...

Eee gads man! Who have you been talking to? There is virtually no difference between an algebraic function and a function in the C family. Now right now you may be thinking "But in Math class the answer would be a range\set of numbers. Not a definitive answer." That's because of the separation between theory and application, we calculate functions like this in theory so that we can make charts so that when we have data to plug in we simply follow the line to the answer. It just so happens that you computer can solve this question about a million and one times before you can ask it, so we don't actually need the chart. I'm sorry if this doesn't make much sense to you, I'm having trouble sleeping so I may be a little off key. Basically what I'm trying to say is that there is no need to simplify the equation, your computer is more then up to a task such as this.
Symbolic differentiation, really! That doesn't seem like something a CPP beginner would do. Aside from the parsing, one would have to code all of the rules for differentiation: constant, sum, product, chain and inverse.

That's you task?
> I'm not asking for a code, I'm asking for ideas...

Assuming that your intent is to just write a program that uses symbolic differentiation (not write one from scratch), the sensible thing to do would be to use a C++ library that has symbolic manipulation capabilities. Every such library would already have built in functionality to support symbolic differentiation.

Google revealed two of them:

Symbolic C++ http://issc.uj.ac.za/symbolic/symbolic.html
http://en.wikipedia.org/wiki/SymbolicC%2B%2B#Examples
This may be all that you need.

GiNaC http://www.ginac.de/tutorial/Introduction.html

Caveat: Both are free software, but are under viral licenses.

Topic archived. No new replies allowed.