Frequently, Mathematica will produce some expression in a complicated form, with a number of unset variables. For me, it is rare that I would be interested in solutions that are generalized to both real and imaginary arguments, so my method is usually to run a FullSimplify on the expression, with every unset variable being assumed be an element of the reals:
FullSimplify[a+Log[Exp[b^2 - c^2]]-Log[d],
Assumptions->{a \[Element] Reals, b \[Element] Reals,
c \[Element] Reals, d \[Element] Reals}]
This is quite cumbersome, especially if the expression has many unset parameters. My question is: Can someone write a function that automatically extracts all unset parameters in an expression, and then uses that to set the Assumptions parameter automatically? The second part I know how to do (Element[#, Reals] & /@ pars
), but not the extracting the unset parameters part. Ideally it would only take the function itself as its argument:
fullSimplifyReals[a+Log[Exp[b^2 - c^2]]-Log[d]]
Edit: I am accepting Szabolics' answer for now, as it seems to do what I want it to in my limited testing. For convenience, here is the functional form of Szabolics' answer:
fullSimplifyReals[x_] := Assuming[_Symbol \[Element] Reals, FullSimplify@x];