Sum of two triangular distributions
 (fucusing on the asymmetric one shown during lectures)

ClearAll["Global`*"]

Let us define the generic triangular, also predefining some sets of parameters

- δp and δn are the right intervals around the modal point (x0) that define the distribution
- h is the pdf at the mod, optained by normalization
- (m1, p1) and (m2,p2) are (slope,intercept) of the straight lines
- trsim is the set of numerical parameters which define the ‘simplest’ symmetric triangular distribution
- trasim, trasim2 and trasim3 characterize some asymmetric distributions
    (in particular, trasim2 refers to the distribution often shown in lectures/seminars)

h:=(2/(δp+δn))

m1:=((h-0)/(x0-(x0-δn)))
p1:=h-m1*x0

m2:=((h-0)/(x0-(x0+δp)))
p2:=h-m2*x0

trsim ={x0->0,δn->1,δp->1};
trasim={x0->0,δn->3/2,δp->1/2};
trasim2={x0->1/2,δn->3/2,δp->1/2};
trasim3={x0->2,δn->1,δp->3};

Let us make some plots (not ow the range in the function Plot go, on purpose, well beyong the range of the functions)

Plot[UnitStep[x+2,2-x]/.trasim3,{x,-3,3}]

t[x_]:=(m1 x+p1)*UnitStep[x-(x0-δn), x0-x]+(m2 x+p2)*UnitStep[x-x0, x0+δp-x]

t[x]/.trasim2

Plot[t[x]/.trsim,{x,-2,2}]

Plot[t[x]/.trasim,{x,-2,1}]

Plot[t[x]/.trasim2,{x,-1.5,1.5}]

Plot[t[x]/.trasim3,{x,0,6}]

Check normalization and evaluate some moments and expected values

Integrate[t[x],{x,-∞,∞},Assumptions->{δn>0 && δp>0}]

eval=Simplify[Integrate[x t[x],{x,-∞,∞},Assumptions->{δn>0 && δp>0} ]/.UnitStep[δp]->1/.UnitStep[δn]->1]

e2val=Simplify[Integrate[x^2 t[x],{x,-∞,∞},Assumptions->{δn>0 && δp>0}]/.UnitStep[δp]->1/.UnitStep[δn]->1]

e3val=Simplify[Integrate[x^3 t[x],{x,-∞,∞},Assumptions->{δn>0 && δp>0}]/.UnitStep[δp]->1/.UnitStep[δn]->1]

e4val=Simplify[Integrate[x^4 t[x],{x,-∞,∞},Assumptions->{δn>0 && δp>0}]/.UnitStep[δp]->1/.UnitStep[δn]->1]

var=Simplify[e2val-eval^2]

eval/.trasim2

N[%]

N[Sqrt[var/.trasim2]]

0.5-0.8*N[Sqrt[var/.trasim2]]

NIntegrate[t[x]/.trasim2,{x,-2,0.23}]

Distribution of the sum of two  iid variables

Sum of two triangular distributions (the first integral tha gets rid of the Dirac Delta is done simply
by hand because Mathematica has a tendency to provide complicate solutions).
And, for simplicity, we just do it for the ‘standard asymmetric triangular’ (trasim2) 
usually shown in lectures and seminars

t2[y_]:=Integrate[(t[x]/.trasim2)*(t[y-x]/.trasim2),{x,-1,1}]

t2[y]

Plot[t2[y],{y,-2.5,2.5}]

[-2,  0.4]:   0.52

Ey=NIntegrate[y t2[y],{y, -2,2}]
Ey2 = NIntegrate[y^2 t2[y],{y, -2,2}]
sigmaY = Sqrt[Ey2-Ey^2]

The approximative value of the median is found, by attempts:

NIntegrate[t2[y],{y,-2,0.3}]

NIntegrate[t2[y],{y,-2,0.34}]

NIntegrate[t2[y],{y,-2,0.36}]

NIntegrate[t2[y],{y,-2,0.37}]

median=0.36+(0.5-0.495281)*(0.37-0.36)/(0.50146-0.495281)

NIntegrate[t2[y],{y,-2,median}]