Given a piecewise function f[t_]:=Piecewise[{{Exp[-1/t^2],t>0},{0,x<=0}}]
, I can define another function like this: g[t_]:=f[t+1]f[1-t]
. Both the functions can be calculated and plotted. But when I define the third function h[t_]:=Integrate[g[x],{x,-:inf:,t}]
, h[t]
cannot be used to plot. Does the definition for h[t]
have anything wrong?
$\begingroup$
$\endgroup$
4
1 Answer
$\begingroup$
$\endgroup$
You have an error in the definition of f[]
and it's faster to use NIntegrate[]
:
f[t_] := Piecewise[{{Exp[-1/t^2], t > 0}, {0, t <= 0}}]
g[t_] := f[t + 1] f[1 - t]
h[t_] := NIntegrate[g[x], {x, -Infinity, t}]
Plot[h[t], {t, -1, 1}]
x <= 0
ort <= 0
inf
? $\endgroup$g
be modified tog[t_] = f[t + 1] f[1 - t] // PiecewiseExpand // Simplify
$\endgroup$