Let's say I have a following pde:
pde = x^2 u[x, y] D[u[x, y], {x}] + v[x, y] D[u[x, y], {y}]
I want select the dependent variables:
desiredResult = {u[x, y], D[u[x, y], {x}], v[x, y], D[u[x, y], {y}] }
I have tried many things and best result is this one:
depVars = {u, v}.
DeleteDuplicates@Flatten[Cases[pde,
Derivative[___][#1][___] | #2[___]] & @@@ Subsets[depVars, {2}], 1]
But it works only for those ones, where dependent variables aren't multiplied with some expression. Is there any way to extract all the dependent variables?