Determine the values of c and d so that E[Y] = c and Var(Y ) = 1 Question
Supppose $X$ is a random PDF $f(x)=\frac{2x}{c^{2}d^{2}}, \quad 0<x<cd$ where $c > 0, \; d > 0$.
Determine the values of $c$ and $d$ so that $\mathbb{E}[X]= c $ and $\mathrm{Var}(x) = 1$
My approach
My approach has been to try and isolate the variables using the given information. I have used $\mathrm{Var}(X) = 1$ as a reference point to start. My work has been as follows:
\begin{align}
    1 &= \mathbb{E}(X^2) - \mathbb{E}[X]^2 \\
    1 &= \int_{0}^{cd} x^{2} \cdot \frac{2x}{c^{2}d^{2}} - \left(\int_{0}^{cd} x \cdot \frac{2x}{c^{2}d^{2}}\right)^2
\end{align}
Following this, I have approached this result:
\begin{align}
 1 = \frac{(cd)^4}{2c^2d^2} - \frac{(cd)^4}{c^4d^4}
\end{align}
Which yields the following:
\begin{align}
    1 &= \frac{c^2d^2}{2} \\
    2 &= c^2d^2 \\
\end{align}
I have then derived the possible inter solutions of $c$ and $d$.
\begin{align*}
        \therefore c &= \pm 1\; ,\pm 2 \\
    d &= \pm 1\; , \pm 2
\end{align*}
I have then tried to prove the $\mathbb{E}[X] = c$ through the following case. Suppose $c = 1$ and $d = 2$ thus $0 < x < 2$.
\begin{align}
    \mathbb{E}[X] &= \int_{0}^{2} x\cdot \frac{2y}{c^{2}d^{2}} \; \mathrm{d}y \\
    &= \int_{0}^{2} \frac{2x^2}{4} \; \mathrm{d}x \\
    &= \frac{1}{4}\int_{0}^{2} 2x^2 \; \mathrm{d}x \\
    &= \frac{1}{4} \cdot \frac{2x^3}{3} \Biggr|_{0}^{2}
\end{align}
However, the answer does not evalute to the case. I have taken the wrong approach and am lost on how to approach the problem. Any help with the solution would be really appreciated.
Update
Thank you for the suggestions. Errors were made in the integration. The error was found within the 2nd integral.
$$
\frac{(cd)^4}{c^4d^4} \rightarrow \frac{2(cd)^3}{3(c^4d^4)}
$$
Squaring the results would give the following $\frac{4c^2d^2}{9}$
The derivation of the expected value for $c$ is as follows
\begin{align}
    c &= \int_{0}^{ac} x \cdot \frac{2x}{c^2d^2} \; \mathrm{d}x \\
    c &= \frac{2}{c^2d^2} \int_{0}^{cd} x^2 \\
    c &= \frac{2}{c^2d^2} \cdot \frac{x^3}{3} \Biggr|_{0}^{cd} \\
    c &= \frac{2x^3}{3c^2d^2} \xrightarrow[]{} \frac{2(cd)^3}{3c^2d^2} \\
    c &= \frac{2}{3}cd \\
    &\therefore d = \frac{3}{2}
\end{align}
Following that, the answer would be simply substituting it into the corrected equation for variance.
\begin{align}
    1 &= \frac{1}{2}c^2\cdot \frac{9}{4} - \frac{4}{9}c^2\cdot\frac{9}{4} \\
    1 &= \frac{9}{4}c^2\left(\frac{1}{2}-\frac{4}{9}\right) \\
    18 &= \frac{9}{4}c^2 \\
    8 &= c^2 \\
    c &= 2\sqrt{2}
\end{align}.

Here's a quick way to solve this. Brief hints are provided for the path to follow. Reveal the spoilers if you get stuck in computations.
You have $\mathbb E[X]=c$. Then put this into the Variance equation.

 \begin{align*}1=\mathrm Var[X]&=\mathbb E[X^2]-\mathbb E[X]^2\\&=\int_{0}^{cd}x^2\frac{2x}{c^2d^2}\ \mathrm dx-c^2\\&=\frac12c^2d^2-c^2\end{align*}

For the expectation, you have

 $$c=\int_{0}^{cd}x\frac{2x}{c^2d^2}\ \mathrm dx=\frac{2}{3}cd\Rightarrow d=\frac32$$

Plugging this in, we get

 $$1=\frac12c^2\frac94-c^2=\frac{c^2}{8}\Rightarrow c=2\sqrt 2$$

and you are done.
