2

Let's say you have a function

$ f(t) = t, \text{ for } t > 0,$

declared in Mathematica as

f[t_?(# > 0 &)] := t;

How do you print that function?

I have tried multiple options like

f[t]
FunctionExpand[f[t], t > 0]
f[t] /; t > 0

These return

f[t]
f[t]
f[t] /; t > 0

and not

t

or

t /; t > 0

Which is what I want.

rhermans
  • 36,518
  • 4
  • 57
  • 149
Sogartar
  • 295
  • 2
  • 5

1 Answers1

4

If possible I would define the function using Simplify or Refine, then use Assuming:

f[t_] /; Refine[t > 0] := t;

Assuming[t > 0, f[t]]
t
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371