I wrote a better version of this in C++, which you can find here. It attempts to do some basic algebraic simplification.
List of allowed functions and characters
All numbers (including the decimal point, when used appropriately)
T (the parameter variable)
Parenthesis (make sure they match!)
+, -, *, /, ^
cos(x), sin(x), tan(x), cot(x), sec(x), csc(x)
arcsin(x), arccos(x), arctan(x)
Use parentheses after each function, and always use * for multiplication. For example, sin(x), sqrt(x), and ln(x).
Sample valid entries:
LaTeX Solution (currently broken):