<font face="verdana,sans-serif">Hello, I've seen a thread last month from </font>Martin Ettl, and I'm having the same problem but the solution proposed by Jens Volling does not work for me.<br><br>I need to derive expressions with variables that depend on others, for example: x(t)^2+sin(y(t)). I need to derive with respect to variable t.<br>
<br>The solution proposed by Jens was: <br><pre>DECLARE_FUNCTION_1P(a)
DECLARE_FUNCTION_1P(b)
REGISTER_FUNCTION(a, dummy())
REGISTER_FUNCTION(b, dummy())
int main()
{
symbol t("t");
ex expr = a(t) * b(t);
cout << expr << endl;
cout << expr.diff(t,1) << endl;
return 0;
}
</pre><br>This does not work with all kind of expressions, for example, with the one I wrote before... if I use this solution with: ex expr = a(t)^2 + sin(b(t)) it throws an error with the operator "^".<br><br>
Any idea how can I do this king of derivations?<br><br>Thank you in advance!<br>Diego H.<br><span style="font-family:verdana,sans-serif"></span><br>