Refine
works with symbols in either way:
Refine[Sqrt[x^2], Element[x, Reals]]
(* Abs[x] *)
Refine[Sqrt[x^2], x > 0]
(* x *)
But assuming positive-valued arbitrary function f[x]
does not work. (Real-valued f[x]
works, though.)
Refine[Sqrt[f[x]^2], Element[f[_], Reals]] (*Works*)
(* Abs[f[x]] *)
Refine[Sqrt[f[x]^2], f[_] > 0] (*Does not work*)
(* Sqrt[f[x]^2] *)
How can I correctly assume that f
is a positive-valued unary function?