Showing that $\mathrm{Var}(X)=\mathrm{Var}(Y)$ Let $X$ and $Y$ be continuous random variables with the following PDF $(b>a)$:

Show that $\mathrm{Var}(X)=\mathrm{Var}(Y)$.
Here is my attempt:
\begin{align*}
\mathrm{Var}(X)&=\mathbb{E}(X^2)-(\mathbb{E}(X))^2 = \int_1^2 bx^2 \, dx + \int_2^4 ax^2 \, dx - \left(\int_1^2 bx \, dx + \int_2^4 ax \, dx\right)^2\\
&=\frac{7b+56a}{3}-\frac{9b^2}{4}-18ba-36a^2\\
\mathrm{Var}(Y)&=\mathbb{E}(Y^2)-(\mathbb{E}(Y))^2 = \int_2^4 ay^2\, dy - \int_4^5 by^2\, dy - \left(\int_2^4 ay\, dy - \int_4^5 by\, dy\right)^2\\
&=\frac{56a-61b}{3}-36a^2+54ab-\frac{81b^2}{4}
\end{align*}
 A: You can also use the symmetry of the problem. Given a random variable $X$ with the first distribution, $Y=6-X$ will have the other distribution. Thus,
$$
\newcommand{\Var}{\mathrm{Var}}
\Var(Y) = \Var(6-X) = \Var(X).
$$
A: $Var(X)$ is correct but there are mistakes in signs while calculation $Var(Y)$.
\begin{align*}
\mathrm{Var}(X)&=\mathbb{E}(X^2)-(\mathbb{E}(X))^2 = \int_1^2 bx^2 \, dx + \int_2^4 ax^2 \, dx - \left(\int_1^2 bx \, dx + \int_2^4 ax \, dx\right)^2\\
&=\frac{7b+56a}{3}- \left(6a+\frac{3b}{2}\right)^2\\
\mathrm{Var}(Y)&=\mathbb{E}(Y^2)-(\mathbb{E}(Y))^2 = \int_2^4 ay^2\, dy + \int_4^5 by^2\, dy - \left(\int_2^4 ay\, dy + \int_4^5 by\, dy\right)^2\\
&=\frac{56a+61b}{3}- \left(6a+\frac{9b}{2}\right)^2
\end{align*}
$ \displaystyle Var(Y) - Var(X) = 18b + \left(6a+\frac{3b}{2}\right)^2 - \left(6a+\frac{9b}{2}\right)^2$
$ \displaystyle = 18b - 36 ab - 18b^2$
Now given the pdf, we also note that $2a + b = 1 \implies 2a = 1 - b$
So, $ \displaystyle Var(Y) - Var(X) = 18b - 18 b (1-b) - 18b^2 = 0$
A: These are not necessarily pdfs since the integral under those curves does not necessarily evaluate to one, but $b+2a$, which could be anything!!!
However these could be two probability spaces $\Omega=[1,4]$ and $\Omega'=[2,5]$. The probability measure on both is given by $\frac 13 \mathcal{L}$ (the Lebesgue measure divided by $3$). There are random variables $X$ defined on $\Omega$ and $Y$ on $\Omega'$. There is a mapping $f:\Omega\rightarrow \Omega', s\mapsto 6-s$ that takes both $\Omega$ to $\Omega'$ and $X$ to $Y$ in the sense: $X = Y \circ f$. Denote the pdf of $X$ by $\psi_X$ and the pdf of $Y$ by $\psi_Y$. By the same token $\psi_X=\psi_Y\circ f\cdot f'$.
Now we can write
$$\mathbb{E}[Y^k]=\int_2^5 Y(s)^k \psi_Y(s)\mathrm{d}y.$$
Now substitute $t=6-s$ and we have
$$=\int_4^1 Y(6-t)^k \underbrace{\psi_Y(6-t) (6-t)'}_{\psi_X(t)}\mathrm{d}t = \int_1^4 X(t)^k \psi_X(t)\mathrm{d}t=\mathbb{E}[X^k].$$
