I want to build a boolean function which takes three one-parametric functions. I really don't know how to write a function for this, but this seems to be working for me as long as the parameter is t
.
isCorrect[f1_, f2_, f3_] := Assuming[t >= 0, Refine[If[
1 + f1 + f2 + f3 >= 0 &&
1 + f1 - f2 - f3 >= 0 &&
1 - f1 + f2 - f3 >= 0 &&
1 - f1 - f2 + f3 >= 0, True, False]]]
For some functions it gives the correct value.
In[]:= isCorrect[Cos[t], Cos[t], 1]
Out[]= True
But for some examples like below it does not output anything.
In[]:= isCorrect[Exp[-t] Cos[t], Exp[-t], Exp[-t]]
Out[]= If[1 - 2 E^-t + E^-t Cos[t] >= 0, True, False]
But I know that Plot[1 - 2 E^-t + E^-t Cos[t], {t,0,10}]
returns the following and is always non-negative for positive t.
So I don't know why isCorrect
does not output True
then.
Any hints would be appreciated.
EDIT:
In[]:= Assuming[t >= 0, Reduce[1 - 2 E^-t + E^-t Cos[t] >= 0]]`
Out[]:= Cos[t] \[Element] Reals && ((E^-t < 0 && Cos[t] <= E^t (-1 + 2 E^-t)) || E^-t == 0 || (E^-t > 0 && Cos[t] >= E^t (-1 + 2 E^-t)))
Why can't it figure out E^-t
can't be negative ever. Also, Cos[t]
is always real since t
is explicitly assumed to be positive.
Reduce[1 - 2 E^-t + E^-t Cos[t] >= 0, t]
can't also decide. SoRefine
returned the expression back. Help onRefine
saysgives the form of expr that would be obtained if symbols in it were replaced by explicit numerical expressions satisfying the assumptions assum
$\endgroup$Refine[If[1 - 2 E^-t + E^-t Cos[t] >= 0, True, False], t >= 0 && 1 >= 2 E^-t - E^-t Cos[t]]
givesTrue
. So I think your conditions you put there are not complete or may be need more refinement. I do not know why Reduce also can't do it. $\endgroup$Assuming[]
will not affectReduce[]
, becauseReduce[]
does not have theAssumptions
option. $\endgroup$In[27]:= Resolve[ ForAll[t, 0 <= t < 40 Pi, 1 - 2 E^-t + E^-t Cos[t] >= 0]] Out[27]= True
But if I replace40Pi
withInfinity
then it returns unevaluated. Go figger. $\endgroup$