## How to find the dependent variables of a different...

Hi everybody,

I have differential equation of the form eq := diff(x(t), t) = x(t) + 1  and I want to find the name of the dependent variable (more generally this issue concerns a differential system in N dependent variables).

How should I use “indets” in order to obtain {t, x(t)} ?

(indets(eq, name) returns {t}, while indets(eq, function) returns {t, x(t), d/dt x(t)}.

## error when using variable...

mas := proc(f)
return ln(diff(rhs(subs(_C1=0,dsolve(diff(y(x),x) = f))), x\$2));
end proc:
mas(exp(x));
mas(mas(exp(x)));
mas(x^2);
mas(x^2+x^3);

when i hard code x, there is no problem in above code.
but when i op to get variable x and run below, it do not have problem when run line by line, but it has problem when run in
procedure
Error, (in mas) invalid input: diff received exp(x), which is not valid for its 2nd argument

mas := proc(f)
local martin:
martin := op(f):
return ln(diff(rhs(subs(_C1=0,dsolve(diff(y(martin),martin) = f))), martin\$2));
end proc:

mas(exp(x));
mas(mas(exp(x)));
mas(x^2);
mas(x^2+x^3);

## indets is different in this case, how to do?...

indets(AA(MM(AA(X1,X2),B2),MM(AA(B2,X3),X5)));
this can get a list of X1,X2,B2,X3,X5

propositionsentence := MM(AA("it", "run"), "maple"):
indets(propositionsentence);

but this can not get "it", "run", "maple"

how to do this in case this in maple 12?