# Piecewise function and integral function

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?

• Please be more specific about what you mean by "cannot be used". Also: did you mean to write x <= 0 or t <= 0 in f? – Szabolcs Jan 29 '15 at 3:46
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Dr. belisarius Jan 29 '15 at 5:13
• Recommend that the definition of g be modified to g[t_] = f[t + 1] f[1 - t] // PiecewiseExpand // Simplify – Bob Hanlon Jan 29 '15 at 5:15
• Thanks, I have revised the question. – Steven_Wang Jan 29 '15 at 7:08

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}}]