I'm not sure how you were using FunctionDomain
, but running the following example gets your error:
f[x_] := If[x < 0, x, x^3]
FunctionDomain[f[x], x, Reals]
(* FunctionDomain::nmet: Unable to find the domain with the available methods. >> *)
Changing If
to Piecewise
works though.
f2[x_] := Piecewise[{{x, x < 0}}, x^3]
FunctionDomain[f2[x], x, Reals]
(* True *)
If you take a look under the "Background" of If
in the documentation, that should clear it up a little as to why If
fails but Piecewise
works.
If
is a procedural programming structure whose evaluation branch is
determined by the truth value of a specified condition.
...
Mathematical functions that evaluate depending on the values of their
arguments include Boole
and Piecewise
.
f[x_] := Piecewise[{{x, x < 0}}, x^3]
instead of usingIf
$\endgroup$