What is the proof for variance of triangular distribution? In Wikipedia, the formula for the variance of the triangular distribution is given here. However, I don't know how to find it. I have tried a brute force method but the formula is quite complicated (polynomial of degree 5 in a, b, c) and I can't simplify it (I tried manually and with Xcas).
The following part is edited thanks to @Imaosome remark:
I came to this question with the following problem:
Say $X$ and $Y$ are independent random variables with uniform distribution between $0$ and $1$.
I want to study $Z = X-Y$. With convolution, I find that the distribution is triangular, centered in $0$ with extremities $-1$ and $1$ (the proof is also available in this pdf here). With Wikipedia notations, it gives $a=-1, b=1, c=0$. And in this case, we sum $2$ independent variables therefore the variance shoud be
$Var(X)+Var(-Y) = Var(X)+Var(Y)=2 Var(X)$. The variance of $X$ is $1/12$ (see for instance formula here). Therefore the variance of $Z$ is $Var(Z) = 2 * 1/12 = 1/6$.
If I come back to Wikipedia formula, I find:
$$
\frac{a^2+b^2+c^2-ab-ac-bc}{18}=\frac{1+1+0+1-0-0}{18}=1/6.
$$
This shows, at least in that particular case that the formula is correct. But I would like to try and prove Wikipedia result. Once again, I know that it should be possible to prove it by integration but I did not succeed and I hope somebody has a simple way to get this formula.
Here are the details. By definition, we want to compute:
\begin{align*}
\sigma^2 &= \int_a^c \frac{2(x-a)}{(b-a)(c-a)} \left( x - \frac{a+b+c}{3} \right)^2 dx + \int_c^b \frac{2(b-x)}{(b-a)(b-c)} \left( x - \frac{a+b+c}{3} \right)^2 dx \\
&= \frac{2}{(b-a)(c-a)} \left[ \frac{1}{3} (x-a) \left( x - \frac{a+b+c}{3} \right)^3 - \frac{1}{12} \left( x - \frac{a+b+c}{3} \right)^4 \right]_a^c \\
& ~~~~~~ \frac{2}{(b-a)(b-c)} \left[ \frac{1}{3} (b-x) \left( x - \frac{a+b+c}{3} \right)^3 - \frac{1}{12} \left( x - \frac{a+b+c}{3} \right)^4 \right]_c^b
\end{align*}
From there, one can see that terms in $\left( x - \frac{a+b+c}{3}\right)$ cancel out leaving us with:
\begin{align*}
\sigma^2 &= \frac{2}{12(b-a)(c-a)} \left( - \left( \frac{2c-a-b}{3} \right)^4 + \left( \frac{2a-b-c}{3} \right)^4 \right) \\
& ~~~~~~ \frac{2}{12(b-a)(b-c)} \left( - \left( \frac{2b-a-c}{3} \right)^4 + \left( \frac{2c-a-b}{3} \right)^4 \right) \\
&= \frac{((c-a)-(b-c))^5 +(b-c)((b-a)+(c-a))^4 - (c-a)((b-a)+(b-c))^4}{ 2 \times 3^5 (b-a)(b-c)(c-a) }
\end{align*}
And from this point, I am stuck. After all, maybe the last line is not helping much. I don't know.

It's a little easier to use the identity $\ \sigma^2=\mathbb{E}\big(Z^2\big)-\mathbb{E}(Z\,)^2\ $:
\begin{align}
\mathbb{E}\big(Z^2\big)&=\frac{2}{(b-a)(c-a)}\int_a^cx^2(x-a)\,dx\\
&\hspace{2em}+\frac{2}{(b-a)(b-c)}\int_c^bx^2(b-x)\,dx\\
&=\Bigg(\frac{2}{(b-a)(c-a)}\Bigg)\Bigg(\frac{c^4-a^4}{4}-\frac{a\big(c^3-a^3\big)}{3}\Bigg)\\
&\hspace{2em}+\Bigg(\frac{2}{(b-a)(b-c)}\Bigg)\Bigg(\frac{b\big(b^3-c^3\big)}{3}-\frac{b^4-c^4}{4}\Bigg)\\
&=\Bigg(\frac{1}{(b-a)(c-a)}\Bigg)\Bigg(\frac{3\big(c^4-ac^3\big)+a^4-ac^3}{6}\Bigg)\\
&\hspace{2em}+\Bigg(\frac{1}{(b-a)(b-c)}\Bigg)\Bigg(\frac{3\big(c^4-bc^3\big)+b^4-bc^3}{6}\Bigg)\\
&=\Bigg(\frac{1}{(b-a)(c-a)}\Bigg)\Bigg(\frac{3c^3(c-a)+a(a-c)\big(a^2
+ac+c ^2\big)}{6}\Bigg)\\
&\hspace{2em}+\Bigg(\frac{1}{(b-a)(b-c)}\Bigg)\Bigg(\frac{3c^3(c-b)+b(b-c)\big(b^2+bc+c^2\big)}{6}\Bigg)\\
&=\frac{3c^3-a^3-a^2c-ac^2}{6(b-a)}+\frac{b^3+b^2c+bc^2-3c^3}{6(b-a)}\\
&=\frac{a^2+b^2+c^2+ab+ac+bc}{6}\\
\mathbb{E}(Z\,)^2&=\Big(\frac{a+b+c}{3}\Big)^2\\
&=\frac{a^2+b^2+c^2+2ab+2ac+2bc}{9}\\
\sigma^2&=\mathbb{E}\big(Z^2\big)-\mathbb{E}(Z\,)^2\\
&=\frac{a^2+b^2+c^2-ab-ac-bc}{18}
\end{align}
