In[]:=
Clear["Global`*"]
In[]:=
tlim=6;​​v[t_]:=
0
t≤0
4t
0≤t≤1
4
-(t-1)

t⩾1
​​i[t_]:=
0
t≤0
2×
-6
10
0≤t≤1
-2×
-6
10
-(t-1)

t⩾1
​​p[t_]:=v[t]i[t]​​w[τ_]:=
τ
∫
0
p[t]t//N
Plot the voltage, current, power and energy
In[]:=
p1=Plot[v[t],{t,0,tlim},PlotLabel->Style["v(t)",12],ImagePadding->25,PlotRangeAll];​​p2=Plot[i[t],{t,0,tlim},PlotLabel->Style["i(t)",12],ImagePadding->25,PlotRangeAll];​​p3=Plot[p[t],{t,0,tlim},PlotLabel->Style["p(t)",12],ImagePadding->35,PlotRangeAll];​​p4=ListPlot[Table[w[τ],{τ,0,tlim,tlim/100}],PlotLabel->Style["w(t)",12],Filling->Axis,TicksAutomatic];​​GraphicsGrid[{{p1},{p2},{p3},{p4}},FrameAll,ImageSize->400]
Out[]=