This is a really big problem which cannot be adequately solved in a Quick Answer. The problem is: this is not a numeric problem. This is a problem of creation or using of a Computer Algebra System:
http://en.wikipedia.org/wiki/Computer_algebra_system[
^].
Such systems perform
analytic (symbolic), not numeric solutions. "Symbolic" does not mean they have anything to do with strings representing expression. Instead, they operate on
expression trees. I developed such solution but not ready to give you any detail, by many reasons. One of such reasons is: I don't believe you have enough knowledge/experience at this moment. If you think you do, it would be great: you could do some good research and use some available system (which is not easy at all, by, again, many reasons), or develop you own.
Besides, what you show in your string, is not an equation. At best, this is only its left of right part. That said, your solution is simply undefined. (That's why I though that you skills of solving such big problems are way insufficient; sorry if I'm wrong.) Besides, chances are, the solution may become unresolvable analytically. If you give us missing part of equation, we may help to solve it or tell you if it seems unsolvable.
Besides, you can solve it digitally. Instead of pointless
string s ="cos(x)+ln(x)-e^x";
write the function:
using System;
(x) => { return Math.Cos(x) + Math.Log(x) - Math.Exp(x); }
double LeftPart(dounle x) { return Math.Cos(x) + Math.Log(x) - Math.Exp(x); }
and try to use it to find the solution (again, it will depend on what do you have on right/left part of your equation).
There are many numeric methods for solving equations which are already implemented, you can learn them. This is a whole big topic. In all cases, you can create some solution by yourself (can you? :-))…
—SA