# FullSimplify assumptions for function body

I'd like to pass an assumption to FullSimplify so whenever it gets a function that is squared and square rooted would return me only the function body, without Abs[f] (I've tried assumption _Symbol ∈ Reals && _Symbol > 0 but it gives Abs[f] instead of f.

f[x_] := a x^2;
FullSimplify[Sqrt[f[x]^2], _Symbol ∈ Reals && _Symbol > 0]

x^2 Abs[a]

• FullSimplify[Sqrt[f[x]^2], _Symbol \[Element] Reals] /. Abs[v_] -> v May 23, 2014 at 19:07

Try this:

FullSimplify[Sqrt[f[x]^2], TransformationFunctions -> {Automatic, PowerExpand}]

• That's exactly the kind of fix I've been looking for! Big thanks! May 30, 2014 at 22:23

I'm not sure about the syntax you have used in the second argument of FullSimplify. How about the following

Clear@f
f[x_] := a x^2;
FullSimplify[Sqrt[f[x]^2],
x \[Element] Reals && x > 0 && a \[Element] Reals && a > 0]

a x^2

• I'd like it to work with any function, not just a function with "a" and "x" May 23, 2014 at 16:08

Try this (for any symbols):

Unprotect[Greater];
SetAttributes[Greater, {Listable}];
f[x_] := b a x^2;
list = Cases[f[x], _Symbol];
FullSimplify[
Sqrt[f[x]^2], _Symbol \[Element] Reals && And @@ Greater[list, 0]]

(*   a b x^2      *)

• Nice, but could have unpredictable consequences.. May 30, 2014 at 22:25