User Input and Derivatives with SymbolicC++
Hello, I'm working on a project that requrires that I let the user input a nonlinear function to then have the derivative taken from it using C++. I am attempting to use SymbolicC++ but when taking in the user's input as a string, it takes the entire string as a constant. I tried using this for guidance but I don't think they realized it: https://social.msdn.microsoft.com/Forums/vstudio/en-US/fe63ea49-08bb-4755-ad0d-bcdb6ffeb71b/taking-input-for-symbolic-expressions-in-symbolicc?forum=vcgeneral (or maybe I'm missing something.)
#include <iostream>
#include <string>
#include "symbolicc++.h"
using namespace std;
int main(void)
{
string inp;
Symbolic x("x");
cout << "Input: "; //input: 3*x*x
getline(cin, inp);
Symbolic input(inp);
cout << "Derivative: " << df(input, x); //output: 0
cout << endl;
cout << "Integral: " << integrate(input, x); //output: 3*x*x*x
return 0;
}
If anyone has any suggestions as to what I can do to symbolically take a user's input to find derivatives with SymbolicC++ or some other package in C++ that'd be much appreciated. Additionally this was the only other source of information I could find on the package: http://symboliccpp.sourceforge.net/introsymb.pdf